Plesk is not accessible: ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] Connection refused

Created:

2017-06-16 04:46:06 UTC

Modified:

2017-08-16 17:05:52 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Plesk is not accessible: ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] Connection refused

Applicable to:

  • Plesk for Linux

Symptoms

  1. Plesk is not accessible with the following error:

    ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] Connection  refused

    Additionally, an exception has occurred while trying to report this error: Zend_Exception
    No entry is registered for key 'translate' (Abstract.php:144)

    Search for related Knowledge Base articles

    ERROR: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Connection refused' in /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:129 Stack trace: #0 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:dbname=ps...', 'admin', '$AES-128-CBC$ic...', Array) #1 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect() #2 /usr/local/psa/admin/externals/Zend/Db/Adapter/Abstract.php(460): Zend_Db_Adapter_Pdo_Mysql->_connect() #3 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('select param, v...', Array) #4 /usr/local/psa/admin/plib/Db/Adapter/Pdo/Mysql.php(30): Zend_Db_Adapter_Pdo_Abstract->query('select param, v...', Array) #5 /usr/local/psa/admin/plib/db.php(36): Db_Adapter_Pdo_Mysql->query('select param, v...') #6 /usr/local/psa/admin/plib/db.php(212): db_query('select param, v...', false) #7 /usr/local/psa/admin/plib/Plesk/Mode.php(423): ge (Abstract.php:144)
  2. Unable to start mysqld service:

    # service mysqld start
    MySQL Daemon failed to start.
    Starting mysqld: [FAILED]
  3. The following errors could be found in /var/log/mysql.log

    2017-06-15 23:56:14 4647 [Note] Server hostname (bind-address): '203.0.113.2'; port: 3306
    2017-06-15 23:56:14 4647 [Note] - '74.208.146.70' resolves to '203.0.113.2';
    2017-06-15 23:56:14 4647 [Note] Server socket created on IP: '203.0.113.2'.
    2017-06-15 23:56:14 4647 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
    2017-06-15 23:56:14 4647 [ERROR] Do you already have another mysqld server running on port: 3306 ?
    2017-06-15 23:56:14 4647 [ERROR] Aborting

Cause

MySQL service is binded to a wrong IP address at /etc/my.cnf

Resolution

  1. Check the file /etc/my.cnf and comment the line with bind-address :

    # grep 'bind-address' /etc/my.cnf
    #bind-address=203.0.113.2
  2. Start MySQL\MariaDB service:

    # service mysqld start
    Starting mysqld: [ OK ]
Have more questions? Submit a request
Please sign in to leave a comment.