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. And you have to use quotes if you want to use the # character in the /.env file values.

Certainly the password of your database includes the # character (which is considered as comment in the new version of Laravel).

The issue has been fixed from LaraClassified (from v6.8) and for JobClass (from v5.6) for fresh installations.
But to quickly fix it for your website, just put this password between quotes and the problem is fixed.

Example: You have to change the database password line in the /.env by putting in quote the password value like this: 

 

NOTE: To be sure to properly update the /.env file (without any issue), we recommend that you modify it directly via a client FTP tool (and not via cPANEL).