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 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 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 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
4 comments
/opt/psa/admin/conf/php.ini (PSA is shortcutted in /usr/local/psa...)
/etc/psa/psa.conf
My server has the same issue and can not upgrade and the info you refer is not stated in the file at all, What does this mean? can add them here?
/etc/mysql/my.cnf
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
[mysqld]
bind-address = ::ffff:127.0.0.1
local-infile=0
sql_mode=""
Hello @Dilan Rostam,
I suggest you check definition in MySQL server configuration files as follows:
# grep -ir "mysql.sock" /etc/mysql/*
In case any further issues occur - please submit ticket to us: https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-
Hi Dilan Rostam.
I have exactly the same problem and I'm kind of desperate. Have you found any solution to this? I will appreciate any help with this.
Thanks!
Hello, @Eduardo Iglesias
As I see you already submitted the ticket to us and the issue was resolved by applying steps from this article: https://support.plesk.com/hc/en-us/articles/115004349394-Plesk-for-Linux-interface-is-inaccessible-Can-t-init-tc-log
Please sign in to leave a comment.