Applicable to:
- Plesk for Linux
Symptoms
-
The following error is shown instead of the Plesk login page:
CONFIG_TEXT: ERR [panel] SQLSTATE[HY000] [2002] No such file or directory
-
Generation of the login link fails:
# plesk login
ERR [panel] SQLSTATE[HY000] [2002] No such file or directory:
0: /usr/local/psa/admin/externals/Zend/Db/Adapter/Pdo/Abstract.php:144
..........
ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory (Abstract.php:144) -
It is possible to login to the Plesk configuration database (psa) using the command:
# plesk db
-
No errors can be found in the MySQL/MariaDB error log (can be located at
/var/log/mysqld.log
,/var/log/mariadb/mariadb.log
or/var/log/mysql/error.log
) even during the restart of the service. -
Manual running of the
backupmng
utility fails with the following error:# plesk sbin backupmng
backupmng: Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
System error 13: Permission denied
backupmng: Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
System error 13: Permission denied
backupmng: Unable to connect to the mysql database -
When deleting a domain or a subscription from Plesk, the following error can be found in the file
/var/log/plesk/panel.log
:CONFIG_TEXT: PHP Fatal error: Uncaught exception 'PleskMultipleException' with message 'Error during example.com removeZone: dnsmng failed: dnsmng: Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
System error 2: No such file or directory
dnsmng: Unable to connect to the mysql database
System error 2: No such file or directory
in /opt/psa/admin/plib/Service/Dns/Connector/Plesk.php:14
Stack trace:
..........
thrown in /opt/psa/admin/plib/Service/Dns/Connector/Plesk.php on line 14
Cause
The sockets specified in the files /etc/psa/psa.conf
and /usr/local/psa/admin/conf/php.ini
differ from the actual MySQL/MariaDB socket defined in the file /etc/my.cnf
(/etc/mysql/my.cnf
on Debian and Ubuntu).
Resolution
-
Connect to the server using SSH.
-
Make sure that the sockets to connect to the MySQL/MariaDB server specified in the files
/etc/psa/psa.conf
and/usr/local/psa/admin/conf/php.ini
are the same as the socket defined in the file/etc/my.cnf
(/etc/mysql/my.cnf
on Debian and Ubuntu):# grep mysql.sock /etc/my.cnf
socket=/var/lib/mysql/mysql.sock# grep mysql.sock /etc/psa/psa.conf
MYSQL_SOCKET /var/lib/mysql/mysql.sock# grep mysql.sock /usr/local/psa/admin/conf/php.ini
pdo_mysql.default_socket="/var/lib/mysql/mysql.sock"
Comments
1 comment
Hi Taras Ermoshin,
After manually setting the above, and testing they are in place:
I have tried to run CLI:
Thus, I have searched for that OTHER path to the socket, and found the below:
Can you please guide me?
Please sign in to leave a comment.