• 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.

Issue 500 Plesk\Exception\Database DB query failed: SQLSTATE[HY000] [2002] Connection refused

bruno97

New Pleskian
When I try to repair the system with the plesk reapir all comand I get:
ERR [panel] Cannot save cli call statistic DB query failed: SQLSTATE[HY000] [2002] Connection refused
SQLSTATE[HY000] [2002] Connection refused
exit status 3

also when I try to just repair the database with plesk repair db or db -y I get:

ERR [panel] Cannot save cli call statistic DB query failed: SQLSTATE[HY000] [2002] Connection refused

Checking the Plesk database using the native database server tools
DB query failed: SQLSTATE[HY000] [2002] Connection refused
The database structure is corrupted. You can try to repair it with "plesk repair installation" and "plesk repair db".

exit status 1

I also tried to load a backup but the problem with the Error SQLSTATE[HY000] [2002] Connection refused blocks it from recovery. Can someone help please?
 
This means the database server can't be accessed, probably because it is not running.
The plesk repair functions for the database are only there to repair damage to the contents of the database, not for problems starting the database server itself.
Check "service mysql status" or "service mariadb status".
 
# service mariadb status -l
Redirecting to /bin/systemctl status -l mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-07-27 13:52:04 CEST; 2h 11min ago
Process: 2877 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 2835 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 2876 (mysqld_safe)
Tasks: 23
Memory: 110.9M
CGroup: /system.slice/mariadb.service
├─ 2876 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─29224 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock

Jul 27 13:52:02 s21794609 systemd[1]: Starting MariaDB database server...
Jul 27 13:52:02 s21794609 mariadb-prepare-db-dir[2835]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Jul 27 13:52:02 s21794609 mariadb-prepare-db-dir[2835]: If this is not the case, make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
Jul 27 13:52:02 s21794609 mysqld_safe[2876]: 210727 13:52:02 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Jul 27 13:52:02 s21794609 mysqld_safe[2876]: 210727 13:52:02 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Jul 27 13:52:04 s21794609 systemd[1]: Started MariaDB database server.
 
and service mysql status returns

# service mysql status
Redirecting to /bin/systemctl status mysql.service
Unit mysql.service could not be found.
 
Back
Top