Forums

_mysql_connector.MySQLInterfaceError: Access denied for user

Hello all,

I hope you can help me with my problem. I have the following error message: _mysql_connector.MySQLInterfaceError: Access denied for user 'gusch88'@'%'@'10.0.0.217' (using password: YES).

I connect via mysql.connector and set the following parameters: {'host': 'gusch88.mysql.pythonanywhere-services.com', 'user': 'gusch88', 'password': '****', 'database': 'gusch88$car_search', }

I have already checked if the password matches the password in the my.cnf file.

In the meantime I am getting a bit desperate... Please help.

There are a few things to check - make sure that your password doesn't contain characters that might need escaping in Python (or, if it does, make sure that you've escaped them correctly). Another thing to check is to make sure that the configuration that you believe is being applied is actually being applied. It is entirely possible that you are looking at some setup code that is not being used for some reason.

Also, if you've edited your .my.cnf file, that does not change your password. Make sure you use the password change form on the Databases page for that.

Strangely, sometimes I can access the DB from within the app and other times not. How can I check which rights the current user has for the respective DB operations?

You can use all the usual MySQL queries and commands (like SHOW GRANT) in a MySQL console to inspect your databases and see the permissions there: https://dev.mysql.com/doc/refman/5.7/en/grant-tables.html