High severityauthentication
MySQL Error:
1045
What does this error mean?
MySQL returns error 1045 when a client connection is rejected at the authentication stage. The server received a username/password combination that does not match any row in `mysql.user`, or the user exists but is not granted access from the connecting host. In data-pipeline context this surfaces when an ADF linked service, dbt profile, or Power BI gateway tries to reach a MySQL source with stale or misconfigured credentials. The symptom is immediate: the connection is refused before any query runs, so the entire pipeline activity fails on the first step. You will typically see `Access denied for user 'someuser'@'10.0.0.5' (using password: YES)` in ADF activity output, dbt logs, or the MySQL general/error log.
Common causes
- 1Incorrect password — the password in your connection string, ADF linked service, or dbt profile does not match the password stored in `mysql.user` for that account.
- 2Host mismatch — the user exists for `'localhost'` or `'127.0.0.1'` but the client connects from a different IP (e.g., an ADF Integration Runtime at `10.0.0.5`). MySQL treats each user+host pair as a separate account.
- 3User does not exist — the account was never created, was dropped, or was created with a typo in the username. `SELECT user, host FROM mysql.user;` will confirm.
- 4Password was changed on the server but not updated in the consuming service — after a credential rotation the old password in ADF, dbt `profiles.yml`, or the Power BI gateway config still gets sent.
- 5Authentication plugin mismatch — MySQL 8.0+ defaults to `caching_sha2_password`, but older connectors or drivers (e.g., older PyMySQL, certain ODBC versions) only support `mysql_native_password`. The handshake fails before the password is even checked.
How to fix it
- 1Step 1: Confirm the user and host grant exist on the server: `SELECT user, host, plugin FROM mysql.user WHERE user = 'your_user';` — if no rows return, the account does not exist.
- 2Step 2: If the user exists but only for `localhost`, create a grant for the connecting host or use a wildcard: `CREATE USER 'your_user'@'%' IDENTIFIED BY 'your_password'; GRANT SELECT ON your_db.* TO 'your_user'@'%'; FLUSH PRIVILEGES;`
- 3Step 3: If the password is wrong or unknown, reset it: `ALTER USER 'your_user'@'%' IDENTIFIED BY 'new_password'; FLUSH PRIVILEGES;`
- 4Step 4: If you suspect an auth-plugin issue (MySQL 8.0+), switch the user to native auth: `ALTER USER 'your_user'@'%' IDENTIFIED WITH mysql_native_password BY 'your_password'; FLUSH PRIVILEGES;`
- 5Step 5: Test the connection from the same network as your pipeline runtime: `mysql -u your_user -p -h your_mysql_host --port 3306` — run this from the ADF Self-Hosted IR machine or the dbt runner to rule out network-level blocks.
- 6Step 6: Update the credential in all consuming services — in ADF: edit the linked service and click 'Test connection'; in dbt: update `profiles.yml` and run `dbt debug`; in Power BI: go to Settings → Data source credentials → Edit credentials.
- 7Step 7: Re-run the failed pipeline activity and verify the connection succeeds before marking the incident resolved.
Example log output
ERROR 1045 (28000): Access denied for user 'etl_user'@'10.0.0.5' (using password: YES)
2026-05-11 08:14:02 [ERROR] ADF activity 'Copy_MySQL_Orders' failed: ErrorCode=UserErrorFailedToConnectToMySql, Message='Access denied for user etl_user@10.0.0.5 (using password: YES)'
2026-05-11 08:14:03 [WARN] dbt source freshness check failed for source.mysql_orders: mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'analytics'@'%'