• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Maria DB broken. Plesk Obsidian 18.0.48.0 CentOS 7.9.2009 x86_64

jazzydan

New Pleskian
Hi There,

I'm getting the following error in Plesk...

Server Error
500 Plesk\Exception\Database

DB query failed: SQLSTATE[HY000] [2002] Connection refused
Type Plesk\Exception\Database
Message DB query failed: SQLSTATE[HY000] [2002] Connection refused
File Mysql.php
Line 79

when I try and run plesk repair all I get the following....

DB query failed: SQLSTATE[HY000] [2002] Connection refused

exit status 1

When I run systemctl status mariadb.service I get this

● mariadb.service - MariaDB 10.5.18 database server


Loaded: loaded (/usr/lib/systemd/system/./mariadb.service; disabled; vendor preset: disabled)


Drop-In: /etc/systemd/system/mariadb.service.d


└─migrated-from-my.cnf-settings.conf


Active: activating (auto-restart) (Result: signal) since Thu 2022-11-24 17:42:32 UTC; 374ms ago


Docs: man:mariadbd(8)


systemd


Process: 3670 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)


Process: 3642 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, signal=ABRT)


Process: 3610 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)


Process: 3607 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)


Main PID: 3642 (code=killed, signal=ABRT)


Status: "Taking your SQL requests now..."


Nov 24 17:42:32 server.isotonikstudios.com systemd[1]: Unit mariadb.service entered failed state.


Nov 24 17:42:32 server.isotonikstudios.com systemd[1]: mariadb.service failed.

I've tried many stop and starts on sql/Maria, I've tried removing and reinstalling Maria, I've tried removing log files, and resetting my.cnf

At this point I'm completely lost and don't know how to fire this server back up. There is plenty of space on the server
devtmpfs 7.9G 0 7.9G 0% /dev


tmpfs 7.9G 0 7.9G 0% /dev/shm


tmpfs 7.9G 749M 7.1G 10% /run


tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup


/dev/md2 28G 604M 27G 3% /


/dev/mapper/vg00-usr 20G 4.4G 15G 24% /usr


/dev/mapper/vg00-home 15G 25M 14G 1% /home


none 7.9G 0 7.9G 0% /tmp


/dev/mapper/vg00-var 311G 173G 127G 58% /var


tmpfs 1.6G 0 1.6G 0% /run/user/0


Any ideas?
 
Many reasons can cause this error.
Most of them are described in the relevant KB articles.
You can find them with a search by the phrase "DB query failed: SQLSTATE[HY000] [2002] Connection refused".

I did this for you: https://support.plesk.com/hc/en-us/search?utf8=✓&query=DB+query+failed:+SQLSTATE[HY000]+[2002]+Connection+refused&commit=Search
thanks very much for taking the time to do that.
I think I tried most of this as a result of my constant googling yesterday.
Many of these are not relevant.
The first one for example, I can't restore the database to SQL as SQL can not be started.
The second didn't make any difference at all.
And so on.
Do I need to reinstall Plesk from scratch?
Can this be done with out loosing the websites on the server?
Thanks
Dan
 
Do I need to reinstall Plesk from scratch?
Can this be done with out loosing the websites on the server?
I think that's too drastic a decision.
It would be more correct to contact Plesk Support Team. Experienced engineers will find the cause and fix it directly on your server.

 
I think that's too drastic a decision.
It would be more correct to contact Plesk Support Team. Experienced engineers will find the cause and fix it directly on your server.

Thank you :) I will try that now.
 
From memory I think this ended up being reasonably straight forward for me in the end. All though that may have just been me. Thanks to the advice from the above gentlemen. What I think had happened is the database had corrupted during an upgrade. So simply preforming the upgrade again from the start seemed to fix the issue. Sorry thats not the most helpful reply in the world.
 
The above error normally means that the database server is offline, and that is most often caused by low disk space. What's the disk space situation on the server and what is the status of the database service?
 
I have no issue for disk space, after change this :

1- Change Folder /var/lib/mysql menjadi /var/lib/mysql_backup

2- Change permission
sudo chown -R mysql:mysql /var/lib/mysql
sudo chmod -R 0700 /var/lib/mysql

3. Mariadb can Start normaly

But i have some new error

1684895720176.png
 
@bonar Please open a ticket with Plesk support. I think the permission or path changes are causing this, but cannot assess from the information given what has all changed and what needs to be fixed.
 
Back
Top