Forums

(1045, "Access denied for user 'user'@'10.0.0.37' (using password: YES)")

Hi, I'm getting an error (1045, "Access denied for user 'Joris11'@'10.0.0.37' (using password: YES)"). I use the settings below Password is configured in the database tab and I checked the my.cnf file to check whether I use the correct one.

app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://Joris11:password@Joris11.mysql.pythonanywhere-services.com/Joris11$strategy_generator'
app.config["SQLALCHEMY_POOL_RECYCLE"] = 299
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False

Can anyone please help me out?

Best regards,

Joris

Make sure that there are no special characters in your password that you need to escape in the Python string.

Hi Glenn,

Thank you for the quick reply. I changed my password but still get the same error, I checked but can't find any special characters in the current one. Could something else be wrong?

Best regards,

Joris

Then the only option left is that you are not using the correct password.

Hi Glenn,

Unfortunately I still have the error. I also deleted my virtualenv en installed a new one. But it doesn't seem to work, my settings:

app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://Joris11:password@Joris11.mysql.pythonanywhere-services.com/Joris11$strategy_generator'

from bash console directly did work with the same settings as described

$ mysql -u Joris11 -h Joris11.mysql.pythonanywhere-services.com -p 'Joris11$strategy_generator'
Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14953579 Server version: 5.7.34-log Source distribution Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Best regards,

Joris

Make sure that you do not have some other code that may be overwriting that config later.

Thank you so much Glen! I forgot about the config file I used....

Have a great day!