Magento CRITICAL Site Down: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
-
28-02-2021 - |
문제
I changed the password in Magento admin panel and cleared the cache via the dashboard. Then my website went completely offline, only to display the multiple lines of text with the 2 exceptions mentioned.
It seems as though the database information within env.php might be encrypted because it has an additional array.
env.php file:
'crypt' =>
array (
'key' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (//not real key)
The following is the error log received when trying to access site:
Exception #0 (Zend_Db_Adapter_Exception): SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
Exception #1 (PDOException): SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
I'm a non-tech guy with novice experience with web development. Any help would be appreciated!
올바른 솔루션이 없습니다
다른 팁
The error says MySQL credentials are invalid, please check database credentials in app/etc/env.php
. If the password is not correct, update the right one.
If the password is correct, try the below steps.
Run the below commands from the Magento root folder
rm -rf generated/code/* generated/metadata/* php bin/magento ca:fl
If you are using php-fpm, you need to restart the php-fpm service as well. Please change the below command depends on the PHP version.
service php7.1-fpm restart