Plesk shows: ERR [panel] SQLSTATE[HY000] [2002] No such file or directory

Created:

2017-06-15 13:38:55 UTC

Modified:

2017-08-08 13:09:01 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Plesk shows: ERR [panel] SQLSTATE[HY000] [2002] No such file or directory

Symptoms

  • Plesk shows:
    ERR [panel] SQLSTATE[HY000] [2002] No such file or directory
  • Unable to generate login link:
    # plesk login
    [2017-06-15 15:26:27] ERR [panel] SQLSTATE[HY000] [2002] No such file or directory:
    0: /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:144
    Zend_Db_Adapter_Pdo_Abstract->_connect()
    1: /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Mysql.php:111
    Zend_Db_Adapter_Pdo_Mysql->_connect()
    2: /usr/local/psa/admin/externals/Zend/Db/Adapter/Abstract.php:460
    Zend_Db_Adapter_Abstract->query(string 'select param, val from misc', array)
    3: /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:238
    Zend_Db_Adapter_Pdo_Abstract->query(string 'select param, val from misc', array)
    4: /usr/local/psa/admin/plib/Db/Adapter/Pdo/Mysql.php:30
    Db_Adapter_Pdo_Mysql->query(string 'select param, val from misc')
    5: /usr/local/psa/admin/plib/db.php:36
    db_query(string 'select param, val from misc', boolean false)
    6: /usr/local/psa/admin/plib/db.php:212
    get_param(string 'disable_provisioning')
    7: /usr/local/psa/admin/plib/Plesk/Mode.php:423
    Plesk_Mode::isProvisioningDisabled()
    8: /usr/local/psa/admin/plib/common_func.php:95
    util_exec(string 'send-error-report', array, array, string 'proc_open', NULL null)
    9: /usr/local/psa/admin/plib/common_func.php:28
    smart_exec(string 'send-error-report', array, array, string 'proc_open')
    10: /usr/local/psa/admin/plib/Os.php:116
    Os::exec(string 'send-error-report', array, string 'proc_open')
    11: /usr/local/psa/admin/plib/CommonPanel/Exception.php:329
    CommonPanel_Exception::_sendRuntimeReportXML(string 'Zend_Db_Adapter_Exception', string 'SQLSTATE[HY000] [2002] No such file or directory', string '/usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php', integer '144', integer '2002', string '#0 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
    #1 /usr/local/psa/admin/externals/Zend/Db/Adapter/Abstract.php(460): Zend_Db_Adapter_Pdo_Mysql->_connect()
    #2 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(string 'SET sql_mode = ''', array)
    #3 /usr/local/psa/admin/plib/Db/Adapter/Pdo/Mysql.php(30): Zend_Db_Adapter_Pdo_Abstract->query(string 'SET sql_mode = ''', array)
    #4 /usr/local/psa/admin/plib/CommonPanel/Application/Abstract.php(90): Db_Adapter_Pdo_Mysql->query(string 'SET sql_mode = ''')
    #5 /usr/local/psa/admin/plib/api-common/AbstractCu.php(1647): CommonPanel_Application_Abstract::initDbAdapter()
    #6 /usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php(21): AbstractCu::initDb()
    #7 /usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php(35): CliUtilityRunner->run()
    #8 /usr/local/psa/admin/plib/api-cli/admin.php(4): require_once(string '/usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php')
    --
    #0 /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct(string 'mysql:dbname=psa;host=localhost;port=3306;charset=utf8', string 'admin', string '******', 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(string 'SET sql_mode = ''', array)
    #4 /usr/local/psa/admin/plib/Db/Adapter/Pdo/Mysql.php(30): Zend_Db_Adapter_Pdo_Abstract->query(string 'SET sql_mode = ''', array)
    #5 /usr/local/psa/admin/plib/CommonPanel/Application/Abstract.php(90): Db_Adapter_Pdo_Mysql->query(string 'SET sql_mode = ''')
    #6 /usr/local/psa/admin/plib/api-common/AbstractCu.php(1647): CommonPanel_Application_Abstract::initDbAdapter()
    #7 /usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php(21): AbstractCu::initDb()
    #8 /usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php(35): CliUtilityRunner->run()
    #9 /usr/local/psa/admin/plib/api-cli/admin.php(4): require_once(string '/usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php')', integer '1', string 'cc38fd4866ead205c2a87021a1d3600e', string '2eb8d2699e722503bf79ae1c7819dc4e')
    12: /usr/local/psa/admin/plib/CommonPanel/Exception.php:170
    CommonPanel_Exception::sendNotification(object of type Zend_Db_Adapter_Exception)
    13: /usr/local/psa/admin/plib/api-common/AbstractCu.php:2432
    AbstractCu::reportError(object of type Zend_Db_Adapter_Exception)
    14: /usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php:27
    CliUtilityRunner->run()
    15: /usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php:35
    require_once(string '/usr/local/psa/admin/plib/api-cli/CliUtilityRunner.php')
    16: /usr/local/psa/admin/plib/api-cli/admin.php:4
    ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory (Abstract.php:144)
  • It's possible to login to psa database using below command:
    # plesk db
  • MySQL error log /var/log/mysqld.log doesn't show any errors even during mysql restart.

Cause

Different mysql sockets for mysql are specified in /etc/my.cnf and /etc/psa/psa.conf.

Resolution

Make sure that socket for mysql specified in /etc/my.cnf and /etc/psa/psa.conf is the same:

# grep mysql.sock /etc/psa/psa.conf
MYSQL_SOCKET /var/lib/mysql/mysql.sock
# grep mysql.sock /etc/my.cnf
socket=/var/lib/mysql/mysql.sock
Have more questions? Submit a request
Please sign in to leave a comment.