MySQL · error reference
MySQL ERROR 1045: Access denied for user
ERROR 1045 (28000): Access denied for user 'app'@'203.0.113.7' (using password: YES)
MySQL accounts are a user AND a host. A password that works from one machine can be refused from another, and the error message already tells you which host MySQL thinks you are.
What the database is telling you
MySQL looked for an account matching both the user name and the client's host, and either found none or found one whose password did not match. The part after the @ is the address MySQL saw — not the one you configured — and (using password: NO) means the client sent no password at all.
Why it shows up in a migration
A migration tool connects from a new address. Accounts created as 'app'@'localhost' or 'app'@'10.%' do not cover it, so the same credentials that work in the application are refused from the migration host.
Common causes
- No account matches this host: the user exists only as 'app'@'localhost' or for a different network range.
- An anonymous account (''@'localhost') is more specific than 'app'@'%' and wins the match, so the password is checked against the wrong account.
- The password is wrong, or the client sent none — the message then ends (using password: NO).
- The address MySQL sees is a NAT gateway or proxy, not the client's own address, so a host-restricted account does not match.
How to fix it
- 1
List every account with this user name, and the host each one allows.
SELECT user, host, plugin FROM mysql.user WHERE user IN ('app', ''); - 2
Create an account for the host in the error (or a deliberately narrow range) and grant only what it needs.
CREATE USER 'app'@'203.0.113.7' IDENTIFIED BY 'new-password'; GRANT SELECT ON shop.* TO 'app'@'203.0.113.7';
- 3
Remove an anonymous account that shadows the real one.
DROP USER ''@'localhost';
- 4
Check which account MySQL actually used once you are in.
SELECT USER(), CURRENT_USER();
What DBShifts does about it
Connection diagnosis classes this as "Authentication failed" and says to check the user, the password and that the account may connect from DBShifts' address — which is the host part MySQL matched against. The read-only user generator at /tools writes the CREATE USER and GRANTs for the host you give it.
Connection diagnosis
Connecting a database?
Add the database to DBShifts and the connection is tested on the spot. If it fails, you get which of these errors it is and what to change — not the driver's raw message. Once it connects, browse it, migrate it, or let an AI agent read it through the gateway with sensitive columns masked.