• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Urgent: ERROR: Plesk DBException

Doctorak

New Pleskian
I am getting the following error after trying to restart the server with Plesk:

ERROR: PleskDBException: Unable to connect to database: mysql_connect(): Connection refused /var/lib/mysql/mysql.sock (Error code: 2002). Please check that database server is started and accessible. (Abstract.php:69)


I've tried to follow this solution: https://kb.plesk.com/en/121057

But the partitions are not above 50%.

rootfs 20G 5,2G 14G 29% /
/dev/root 20G 5,2G 14G 29% /
devtmpfs 7,8G 224K 7,8G 1% /dev
/dev/sda3 1,8T 358G 1,4T 21% /var
tmpfs 7,8G 0 7,8G 0% /dev/shm



Would have problem if I try to reinstall MySQL? I would lose the current DB in Plesk case reinstall?

unfortunately I am not DB bkp.

would be grateful if anyone can help me, I'm still beginner it.
 
Hi Doctorak,
can you check the ownership of the /var/lib/mysql folder...


Code:
# ls -ld /var/lib/mysql
drwx------ 12 mysql mysql 4096 Apr  5 11:29 /var/lib/mysql

Code:
# ls -l /var/lib/mysql
total 133256
drwx------ 2 mysql mysql     4096 Feb 22 21:37 apsc
drwx------ 2 mysql mysql     4096 Feb 22 21:37 horde
-rw-rw---- 1 mysql mysql 35651584 Apr  6 12:10 ibdata1
-rw-rw---- 1 mysql mysql 50331648 Apr  6 12:10 ib_logfile0
-rw-rw---- 1 mysql mysql 50331648 Mar 28 14:52 ib_logfile1
drwx------ 2 mysql mysql     4096 Mar 28 12:01 mysql
-rw-rw---- 1 mysql mysql       15 Mar 28 12:01 mysql_upgrade_info
drwx------ 2 mysql mysql     4096 Mar 28 12:01 performance_schema
drwx------ 2 mysql mysql     4096 Feb 22 21:37 phpmyadmin_
drwx------ 2 mysql mysql    12288 Feb 22 22:26 psa

Let me know how you get on.
Regards


Lloyd
 
Of course, after I put the code: ls -ld /var/lib/mysql
Appeared:
drwxr-xr-x 19 mysql 4096 Apr 17 03:15 /var/lib/mysql

Code: ls -l /var/lib/mysql
drwx------ 2 mysql mysql 4096 Dez 9 17:24 wordpress_ac
drwx------ 2 mysql mysql 4096 Abr 17 01:23 wordpress_te
drwx------ 2 mysql mysql 4096 Dez 11 01:06 wordpress_db
drwx------ 2 mysql mysql 4096 Mai 20 2015 apsc
drwx------ 2 mysql mysql 4096 Abr 12 18:24 wordpressatc_br
drwx------ 2 mysql mysql 4096 Mai 20 2015 horde
-rw-rw---- 1 mysql mysql 572522496 Abr 16 20:42 ibdata1
-rw-rw---- 1 mysql mysql 5242880 Abr 17 03:15 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Abr 17 03:15 ib_logfile1
drwx------ 2 mysql mysql 4096 Set 9 2015 wppix_db
drwx------ 2 mysql mysql 4096 Abr 16 23:57 mysql
srwxrwxrwx 1 mysql mysql 0 Abr 17 03:15 mysql.sock
drwx------ 2 mysql mysql 4096 Jul 28 2015 wordpress_OHome
drwx------ 2 mysql mysql 4096 Jul 23 2015 wordpress_OMusic
drwx------ 2 mysql mysql 4096 Abr 16 23:57 performance_schema
drwx------ 2 mysql mysql 4096 Out 22 03:39 phpmyadmin_oOmOJRE
drwx------ 2 mysql mysql 12288 Fev 10 04:31 psa
drwx------ 2 mysql mysql 4096 Jul 10 2015 roundcubemail
drwx------ 2 mysql mysql 12288 Mai 20 2015 sitebuilder5
drwx------ 2 mysql root 4096 Abr 16 23:57 test
drwx------ 2 mysql mysql 4096 Abr 13 18:28 wordpress_c
 
Last edited:
/var/lib/mysql/mysql.sock apparently are in the directory, then what is the mysql problem does not start?
 
yes, but I received the following error:
Unable to connect to database: /var/lib/mysql/mysql.sock (Error code: 2002). Pl ease check que database server is started and accessible.

exit status 1
 
When you try to start database server manually, do you get timeout or another error?
# /etc/init.d/mysqld start
 
TomBoB, i received the following error:

# /etc/init.d/mysqld start

MySQL Daemon failed to start.
A iniciar o mysqld: failed
 
okay, the log is this:

# tail -f /var/log/mysqld.log

/usr/libexec/mysqld[0x8eb250]
/usr/libexec/mysqld[0x8e11b5]
/usr/libexec/mysqld[0x82b9d5]
/usr/libexec/mysqld[0x81eb2c]
/usr/libexec/mysqld[0x822c73]
/lib64/libpthread.so.0(+0x79d1)[0x7f8630da69d1]
/lib64/libc.so.6(clone+0x6d)[0x7f862f2aa8fd]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
160417 14:40:49 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


# less /var/log/mysqld.log
150823 21:30:57 [ERROR] /usr/libexec/mysqld: Table './wordpress_te/wp_wassup_tmp' is marked as crashed and should be repaired
150823 21:30:58 [ERROR] /usr/libexec/mysqld: Table './wordpress_te/wp_wassup_tmp' is marked as crashed and should be repaired
150823 21:30:58 [ERROR] /usr/libexec/mysqld: Table './wordpress_te/wp_wassup_tmp' is marked as crashed and should be repaired

I received this many: "150823 21:30:57 [ERROR] /usr/libexec/mysqld: Table './wordpress_te/wp_wassup_tmp' is marked as crashed and should be repaired"


any conclusion that can fix this error?
 
Last edited:
Well me managed to track down the cause: heavy database corruption, and where it is located.
Unfortunately I am not a database boffin good enough to adjust the info from the following article into practical action.

Article https://kb.plesk.com/en/116132

Please ask / wait for other forum members to help out further.

Cheers,
Tom

Edit:
there are a few tutorials on the net in case it is super urgent:
https://chrisjean.com/fix-wordpress-database-table-marked-crashed/
http://stackoverflow.com/questions/4357270/php-is-marked-as-crashed-and-should-be-repaired
http://stackoverflow.com/questions/...d-as-crashed-and-last-automatic-repair-failed
 
Last edited:
okay, I tried but I got a Socket error:

# mysqlcheck -uadmin -p`cat /etc/psa/.psa.shadow` -r wordpress_te wp_wassup_tmp

mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) when trying to connect
 
Last edited:
As you can see from the error message, you need to log into the database with 'wordpress_te wp_wassup_tmp' not 'psa exp_event' - but unfortunately I don't have enough DB knowledge to provide you with the exact commands.. :(

Tom
 
Currently I am a bit worried, i'm hours looking for a solution. of course i'm hoping the forum members help, i have my sites offline because of this problem.

now I'm getting this error:

# service mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting mysqld: [FAILED]


# mysql
ERROR 2002 (HY000): Can not connect to MySQL server through socket location '/var/lib/mysql/mysql.sock' (2)
 
Back
Top