SQLSTATE - Access denied for user 'user'@'host' (using password: YES)

If you get the error below after upgraded your website, know that you are on the right way and that this can be fixed quickly.

The Error

SQLSTATE[HYXXX] [XXXX] Access denied for user 'user'@'host' (using password: YES)

Explanation & Solution

In Laravel v5.8.*, Laravel has changed the way it handles the file /.env. You must use quotes if you want to use the # character in /.env file values.

The database password likely includes the # character, which is treated as a comment in the new Laravel version.

This issue has been fixed in LaraClassified (v6.8+) and JobClass (v5.6+) for fresh installations. To fix it on your website, put the password between quotes.

Example: Change the database password line in /.env by quoting the password value:

  • DB_PASSWORD=#aa9u6 becomes DB_PASSWORD="#aa9u6"
  • DB_PASSWORD=aa#9u6 becomes DB_PASSWORD="aa#9u6"
  • DB_PASSWORD=aa9u6# becomes DB_PASSWORD="aa9u6#"

NOTE: To properly update the /.env file without issues, modify it directly via an FTP client rather than cPanel.

Was this article helpful?

Thank you for your feedback!

Still need help? Create a support ticket

Create a Ticket

Common Issues

Mar 24, 2026