Plesk shows an error: Unable to connect to database: mysql_connect(): No such file or directory (auth.php:142)

Refers to:

  • Plesk 12.5 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Created:

2016-11-16 12:44:44 UTC

Modified:

2016-12-21 19:06:53 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Plesk shows an error: Unable to connect to database: mysql_connect(): No such file or directory (auth.php:142)

Symptoms

Plesk is showing an error:

ERROR: PleskFatalException: Unable to connect to database: mysql_connect(): No such file or directory (auth.php:142)

MySQL service is running and show the list of databases:

/etc/init.d/mysqld status
mysqld (pid 14138) is running...


>mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e "show databases;"
+-------------------------+
| Database |
+-------------------------+
| information_schema |
| sitebuilder5 |
| psa |
| wordpress_6 |
+-------------------------+


/usr/local/psa/bin/admin --show-password
SQLSTATE[HY000] [2002] Connection refused

less /var/log/mysqld.log
140212 5:13:03 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.

Cause

Another attempt to start MySQL when it is already running.

Resolution

In order to fix the issue do the following steps:

# /etc/init.d/mysqld stop

Move ibdata1 and copy it back to original filename:

# mv /var/lib/mysql/ibdata1 /var/lib/mysql/ibdata1.moved
# cp -a /var/lib/mysql/ibdata1.moved /var/lib/mysql/ibdata1

Start the service

# /etc/init.d/mysqld start
Have more questions? Submit a request
Please sign in to leave a comment.