0

I have this error, my database is in a service other than magento and the user used to connect to the database is admin, can you help me?

PDOException: Caught PDOException (500): SQLSTATE[HY000] [2002] Connection refused in /var/www/whitelabel/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128
#0 /var/www/whitelabel/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(128): PDO->__construct()
#1 /var/www/whitelabel/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#2 /var/www/whitelabel/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(406): Zend_Db_Adapter_Pdo_Mysql->_connect()
Shoaib Munir
9,59210 gold badges54 silver badges109 bronze badges
asked Apr 8, 2022 at 15:24

1 Answer 1

0

This could be happening for variety of reasons but you can try few things -:

  1. Check PHP-fpm processes running on the server

  2. Check with hosting company may be there is some firewall rules which is preventing connectivity between Magento and MySQL

  3. May be check overrunning cron jobs

  4. If nothing else then restarting MySQL or PHP-fpm could help

  5. Worth checking db permission for the given user

  6. MySQL logs can also give you more information than just connection refused

answered Apr 8, 2022 at 21:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.