I have tried the following script but unfortunately doesn\'t work. I am using a free MySQL database provider. Any ideas?
import MySQLdb
myDB = MySQLdb.conne
GRANT ALL
ON *.*
TO user@192.168.39.17 -- client ip address
IDENTIFIED BY 'pwd';
Edit
This is SQL that you'd run on the database in order to ensure that the user
has access to everything. pwd
is the user
's password.
Basically, this answer assumes that the connection issue is a credentials issue.
open your database in mysql and type the following :
mysql> GRANT ALL ON *.* TO root@'x' IDENTIFIED BY 'Your-password'
where x is the ip address of the user that wants to access your db.
use this link for more information: How to Allow MySQL Client to Connect to Remote MySQL server
This is what I would do
mysql -u XXXX -h 208.11.220.249 -p
. If your mysql client can not connect, then there is no way you can connect using pythonYou don't have permission for connecting to database with this user. Follow these steps:
1.try connecting to mysql DB: mysql -h208.11.220.249 -uXXXXX -pXXXXX XXXXX
2.If you don't have permission for connecting to DB ,try creating user that has remote permission
GRANT ALL ON DB.* -- Database name TO user@ip -- client ip address IDENTIFIED BY 'pwd';
3.on the last check my.cnf . "bind-address" must be 0.0.0.0 If you want to connect all remote addresses.