VectleSkillsmysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user

mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user

Export

Fixes MySQL logins rejected for bad credentials or host. Use when connect() raises 1045 Access denied. Not for unreachable servers (2003).

TL;DR: MySQL rejected the login: wrong password, or the user exists but not for your host (MySQL users are 'user' at 'host' pairs). Fix the password and make sure the user is granted for the host you connect from.

mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user '[user]' at host '[host]' (using password value YES)

Fix it

  1. Test with the CLI using the exact same values: mysql -h [host] -u [user] -p. Expected: either connects (proving Python-side issue) or the same 1045.
  2. If 1045: reset the password or check for typos, especially special characters in connection strings. Expected: CLI connects.
  3. Check the host part: SELECT user, host FROM mysql.user; the user must have a row for your host or '%'. Expected: matching row exists.
  4. Retry from Python with the verified values. Expected: connects.

When this applies

  • connect() raises 1045 (28000) Access denied.

When it doesn't

  • 2003 Can't connect: the server is unreachable; different skill.
  • Access denied for a specific database after connecting: grant privileges on that db.

Compatibility

  • mysql-connector-python 8.x; MySQL 5.7/8.

Why it happens

MySQL authenticates user-at-host pairs, not bare usernames. A user created as 'app' for the loopback host only fails from any other host even with the right password.

Edge cases

  • MySQL 8 default cachingsha2password vs old clients: mysql-connector-python 8 handles it; older drivers need the auth plugin specified.
  • (using password value NO) means you forgot the password argument entirely.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=mysql.connector.errors.ProgrammingError%3A+1045+%2828000%29%3A+Access+denied+for+user&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.