Overview
Customers may encounter an error message, “Connection Failed [HY000] [MySQL] [ODBC 3.51 Driver] Access denied for user sql@172.28.129.41 (using password: YES)”, also known as error 1045, when trying to connect to MYSQL using an external tool. This issue typically arises due to incorrect or insufficient permissions for the MySQL user to connect from the specified IP address.
Solution
To resolve this issue, follow these steps:
- Verify the username and password being used for the MySQL login attempt.
- Log in to the Exinda using SSH.
- Go to the shell. Generate a key if needed. Generating a Shell Unlock Key and Activating the Restricted Commands License – Exinda Support
- Connect to the monitor database using the
mysql monitor
command. - Check the MySQL user permissions. Ensure the MySQL user exists and has the correct permissions.
- You can check this by running: SELECT User, Host FROM mysql.user;
- The following command allows access to MYSQL from IP adderess 172.28.129.41 for the sa user.
- GRANT ALL PRIVILEGES ON *.* TO 'sa'@'172.28.129.41' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;` Note: Replace `'password'` with the correct password.
- You may also grant access to the sa account or other accounts from all IP addresses using the following command:
- GRANT ALL PRIVILEGES ON *.* TO 'sa'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; Note: Replace `'password'` with the correct password.
This command allows the 'sa' account to connect to the database using mysql, database.net, and in Excel. It may also allow all IP addresses to connect.
Summary
MySQL connection error 1045 when extracting a backup of the Exinda database is typically due to incorrect or insufficient user permissions. The issue can be resolved by verifying the MySQL login credentials, checking and updating user permissions, ensuring MySQL allows connections from the specified IP, and confirming the correct MySQL port is being used. If the issue persists, permissions may need to be manually set in the MySQL database.
FAQ
-
What is MySQL error 1045?
MySQL error 1045 is a common error that occurs when a user tries to connect to a MySQL server with an incorrect username or password. -
How can I check the MySQL user permissions?
You can check the MySQL user permissions by running the command: `SELECT user, host FROM mysql.user;` in the MySQL shell. -
What does the command `GRANT ALL PRIVILEGES ON *.* TO 'sa'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;` do?
This command grants all privileges to the 'sa' user from any host, identifies the user with the password 'password', and then refreshes the server's privilege tables to ensure the changes take effect immediately.