• 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 URGENT: DB query failed: SQLSTATE[HY000] [2002] No such file or directory

Samuel Desloges

Basic Pleskian
HI,
After upgrading MariaDB like here:

I can't access to Plesk:

Server Error
500 Plesk\Exception\Database
DB query failed: SQLSTATE[HY000] [2002] No such file or directory
TypePlesk\Exception\Database
MessageDB query failed: SQLSTATE[HY000] [2002] No such file or directory
FileMysql.php
Line60


I can't restart MariaDB, with the ssh command:
# systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.



How to repair access to plesk?

Thanks.
 
systemctl status mysql.service
● mysql.service - LSB: start and stop MariaDB
Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2020-05-03 09:44:04 CEST; 22min ago
Docs: man:systemd-sysv-generator(8)
Process: 21147 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=1/FAILURE)

May 03 09:44:02 ns397050.ip-94-23-52.eu systemd[1]: Starting LSB: start and s...
May 03 09:44:02 ns397050.ip-94-23-52.eu mysql[21147]: Starting MariaDB.200503...
May 03 09:44:02 ns397050.ip-94-23-52.eu mysql[21147]: 200503 09:44:02 mysqld_...
May 03 09:44:04 ns397050.ip-94-23-52.eu mysql[21147]: ./etc/rc.d/init.d/mysql...
May 03 09:44:04 ns397050.ip-94-23-52.eu mysql[21147]: ERROR!
May 03 09:44:04 ns397050.ip-94-23-52.eu systemd[1]: mysql.service: control pr...
May 03 09:44:04 ns397050.ip-94-23-52.eu systemd[1]: Failed to start LSB: star...
May 03 09:44:04 ns397050.ip-94-23-52.eu systemd[1]: Unit mysql.service entere...
May 03 09:44:04 ns397050.ip-94-23-52.eu systemd[1]: mysql.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
 
Is it maybe possible to restore MariaDB with the dump created before the upgrade corruption?
Yesterday, before the upgrade, the system was ok!
 
is there any hint in /var/log/messages ?

It looks to me like you have serious problems even starting mysql.

This shows it didn't successfully start:
Code:
systemctl status mysql.service
● mysql.service - LSB: start and stop MariaDB
  Loaded: loaded (/etc/rc.d/init.d/mysql; bad; vendor preset: disabled)
  Active: failed (Result: exit-code) since Sun 2020-05-03 09:44:04 CEST; 22min ago
    Docs: man:systemd-sysv-generator(8)
 Process: 21147 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=1/FAILURE)

The database data may be intact already so a dump may not be the place to start.
 
Thank you so much to Nelson. He was so patient and sorted out the issue I had with Plesk and my server.
Nelson is highly professional and dedicated.
Neslon is an expert and I would recommend him to all users.
 
Yes, same error here... Suddenly without doing anything error:

"DB query failed: SQLSTATE[HY000] [2002] No such file or directory"

Can not restart mariadb service...

What can we do? Very urgent...
 
hi there, i have the same issue, is there anyone an answer? or how to solve, i've been try this

Code:
You could first try:
# plesk repair db -y

Then, if that did not solve the issue,
# plesk repair installation

If the issue still exist:
# plesk installer --select-release-current --reinstall-patch --upgrade-installed-components

but nothing :(
 
I just installed a new plesk and I saw not working in the morning. Is there a workaround for that? I only installed plesk to a fresh ubuntu 18.04 that's it.
 
Error message "DB query failed: SQLSTATE[HY000] [2002] No such file or directory" is just an indicator that something wrong with your SQL server. A lot of reason for this failure can be there and no only one common solution. This error means that you have to investigate mysql log and find a reason why mysql server can't start. After that, you have to fix the issue. Some reasons and ways to fix them can be found by a simple search in the KB articles. This is the answer to the question:
Is there a workaround for that?
 
The thing is. I installed a fresh ubuntu 18.04 and installed fresh plesk. It worked. And then in the morning it was not running.
I installed fresh ubuntu and fresh plesk again. Now it is not working again. So it is the installation problem. That's why I am asking if there's a workaround.
 
Have you troubleshooted why your MySQL server is stopped there?
 
No IPV6 on the system

/var/log/mysql/error.log output like that:
2020-06-16 7:18:13 140488270560384 [ERROR] Failed to create a socket for IPv6 '127.0.0.1': errno: 97.
2020-06-16 7:18:13 140488270560384 [ERROR] Can't create IP socket: Address family not supported by protocol
2020-06-16 7:18:13 140488270560384 [ERROR] Aborting

/etc/mysql/my.cnf removing binding solved the problem.
#bind-address = ::ffff:127.0.0.1

What I meant is, plesk installation without any modification, fails if ipv6 is disabled on ubuntu 18.04.
 
Last edited:
Back
Top