I'm getting authentication error in connecting to remote Mysql. Code:
import MySQLdb as mdb
con = mdb.connect(host='xxx',port=3306,user= 'user', passwd='123',db= 'stellar')
cur = con.cursor()
cur.execute('show tables')
for r in cur:
print(r)
Error:
Traceback (most recent call last):
File "C:/staging_files/test.py", line 5, in <module>
con = mdb.connect(host='xxx',port=3306,user= 'user', passwd='123',db= 'stellar')
File "C:\Python34\lib\site-packages\MySQLdb\__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "C:\Python34\lib\site-packages\MySQLdb\connections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'user'@'10.212.148.49' (using password: YES)")
I tried some of solutions suggested here. I ran command on Windows server hosting MySQL-
GRANT ALL ON DB.stellar TO user@xxx IDENTIFIED BY '123';
I also added-
bind-address = 0.0.0.0
to my-default.cnf file