• 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

MySQL intermittent problem?

mikemarsden

New Pleskian
Without any recent changes to our site/server, we now have an intermittent MySQL problem. Any site or part of that uses a database, or even Plesk dashboard itself, sometimes works, but will also sometimes in the same session, will not work and give us errors like:
ERROR: PleskFatalException
Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: MySQL server has gone away

0: common_func.php3:153
psaerror(string 'Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: MySQL server has gone away')
1: auth.php3:112

OR

ERROR: PleskFatalException
Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: No such file or directory

0: common_func.php3:153
psaerror(string 'Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: No such file or directory')
1: auth.php3:112

Refreshing the screen often works, It feels like a small problem but I can't work it out? Tried restarting MySQL server. Anyone have an idea? Much appreciated!

Thank you
 
Please make sure your MySQL service is running on your server

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa

If it's working fine. Please increase the connection limit in your MySQL configuration file
 
Thanks for the reply, I'm new to this so not sure how to do it? I did the command in PuTTY and I think Mysql is working, not sure hot to get to Config file though?
 
[root@vps79259505 ~]# mysql -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib /mysql/mysql.sock' (2)
 
[root@vps79259505 ~]# service mysql service
mysql: unrecognized service

BUT

[root@vps79259505 ~]# /etc/init.d/mysqld status
mysqld (pid 13946) is running...

YET

ERROR: PleskFatalException
Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Connection refused
 
Last edited:
[root@vps79259505 ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.69 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
 
It's seems that there is no issues with the mysql as you are able to login your plesk DB through plesk admin password which is stored in your /etc/psa/.psa.shadow file

And on the plaesk when the mysql services is down plesk is showing following error


Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: No such file or directory


But currently you are getting "Connection refused" massages when you tried to login your plesk panel so I will suggest you please check your plesk Control Panel logs

Error log: /var/log/sw-cp-server/error_log
Access log: /usr/local/psa/admin/logs/httpsd_access_log
Panel log: /usr/local/psa/admin/logs/panel.log
 
Parallels support tell me it is because I have a corrupt PSA database, but are not willing to help further than that? (even though they charged me) So now I am left not knowing what to do..? I hear that the PSA database can not be repaired, but do not know if it can be reinstalled if anyone can help?

Thanks in advance!

Now can't use Plesk Control panel:

ERROR: PleskMainDBException
MySQL query failed:

Additionally, an exception has occurred while trying to report this error: PleskMainDBException
MySQL query failed:

0: common_func.php3:220
db_query(string 'insert into log_actions(date, ip_address, user, action_id, object_id) values (NOW(), '86.158.15.60', 'admin', '66', '0')')
1: class.ActionLog.php:722
ActionLog->submitAction_()
2: class.ActionLog.php:673
ActionLog->submit()
3: cmd_loginup.php:311
createSessionAdmin(string 'admin', string '************', string '**************************', boolean false)
4: cmd_loginup.php:88
createSession(string 'root', string '************')
5: login_up.php3:40
 
[root@vps79259505 ~]# /var/log/sw-cp-server/error_log
-bash: /var/log/sw-cp-server/error_log: Permission denied
[root@vps79259505 ~]# /usr/local/psa/admin/logs/httpsd_access_log
-bash: /usr/local/psa/admin/logs/httpsd_access_log: Permission denied
[root@vps79259505 ~]# /usr/local/psa/admin/logs/panel.log
-bash: /usr/local/psa/admin/logs/panel.log: Permission denied
[root@vps79259505 ~]#
 
Looks like Plesk update has wiped the PSA database? Parallels (paid) support have been on the case for 2 days now, still no where nearer...

"Hello,

I have tried to repair psa database however, it was not helpful.

I have created a separate psa backup from /var/lib/psa/dumps/mysql.daily.dump.0 and tried to restore that but that it is showing error given below.

++++++++++

[root@vps79259505 dumps]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa < psa.sql
ERROR 2013 (HY000) at line 12: Lost connection to MySQL server during query

++++++++++

I will check this further and will update you in next 8 hours. Please standby."
 
I have the exact same problem.
Can’t start Mysql.
I’ve done nothing but happened maybe on this Friday or Saturday.
I think it’s caused by auto update.
 
Back
Top