MySQL error 1045: Access denied for user
MySQL answered the connection attempt but rejected the login.
ERROR 1045 (28000): Access denied for user 'demo_user'@'localhost' (using password: YES)The account and host vary. using password: YES means a password was supplied; it does not confirm that it was correct.
What MySQL error 1045 means
Section titled “What MySQL error 1045 means”MySQL identifies an account by both its user name and client host. A password that works from one host can fail from another.
Check these causes in order:
- An incorrect user name or password.
- Credentials for a different server or branch.
- An account host rule that excludes this client.
- Required TLS or client certificates that the connection does not supply.
Check a local or Docker login
Section titled “Check a local or Docker login”Test the same TCP endpoint and account that you entered in TableAI:
mysql --protocol=TCP -h 127.0.0.1 -P 3306 -u demo_user -pReplace the port and user with your own. Enter the password at the prompt. For Docker, use the published host port.
If you administer MySQL, inspect the account from an administrator session:
SELECT User, Host FROM mysql.user WHERE User = 'demo_user';SHOW GRANTS FOR 'demo_user'@'localhost';Use the actual account and host in both statements. Correct that account’s credentials or host rule. Restrict access to the intended clients when changing a host rule.
For an existing Docker volume, check the password stored in MySQL. Changing a container environment variable does not necessarily update that account.
Check a cloud login
Section titled “Check a cloud login”- Compare the connection endpoint with the server or branch that issued the credentials.
- Check the exact database user name and current password.
- Match the host’s TLS requirements.
- Test the connection again.
Use the host guide for RDS, Azure, Cloud SQL, or PlanetScale. Use TLS troubleshooting for certificate failures.
Ask a server administrator
Section titled “Ask a server administrator”Provide the host, port, database, user, client host from the error, and failure time with time zone. Include the error code and redacted message. Ask for a check of the matching account and its connection requirements; never send the password.
How TableAI shows it
Section titled “How TableAI shows it”TableAI labels this server error Access Denied. Its recovery hint points to the user name, password, and allowed client host.
If no server response arrives, use connection troubleshooting instead. After connecting, continue with write and run SQL, or return to the MySQL overview.