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=#aa9u6becomesDB_PASSWORD="#aa9u6"DB_PASSWORD=aa#9u6becomesDB_PASSWORD="aa#9u6"DB_PASSWORD=aa9u6#becomesDB_PASSWORD="aa9u6#"
NOTE: To properly update the /.env file without issues, modify it directly via an FTP client rather than cPanel.