All Products
Search
Document Center

ApsaraDB RDS:What do I do if the "ERROR 1045 (28000): Access denied for user" error message is displayed when I connect to an ApsaraDB RDS for MySQL instance?

Last Updated:Mar 28, 2026

ERROR 1045 (28000): Access denied for user means the username or password used to connect is invalid. The end of the error message tells you which scenario applies:

  • using password: YES — a password was provided but is incorrect, or the username does not exist.

  • using password: NO — no password was included in the connection string.

Fix "using password: YES" errors

Work through the following checks in order.

Check 1: Verify the username

ApsaraDB RDS for MySQL does not provide root accounts. If you are trying to connect as root, create a dedicated account instead. See Create accounts and databases for an ApsaraDB RDS for MySQL instance.

Check 2: Escape special characters in the password

If the password contains special characters, wrap it in single quotation marks in your connection command:

mysql -h <host> -u <username> -p '<your-password>'

Without the quotes, the shell interprets special characters as command operators, causing authentication to fail with the wrong password.

Check 3: Reset a forgotten password

  1. Log on to the ApsaraDB RDS console.

  2. Go to the instance details page and click Accounts.

  3. Find the account and change its password.

The new password takes effect after a few minutes.

Check 4: Fix the error in DMS

If the error appears in Data Management Service (DMS):

  1. Right-click the instance name and click Edit.

  2. Set Access mode to Security Hosting - Manual.

  3. Enter the correct account and password.

Fix "using password: NO" errors

ERROR 1045 (28000): Access denied for user 'XXX'@'XXX' (using password: NO)

This error means no password was passed to the server. Add the -p flag to your connection command, or verify that the password field in your connection configuration is not blank.

Related topics

Application scope

RDS for MySQL instances