Recently, we encountered this error on one of our servers, and here’s how we resolved it.
Additional Errors Displayed on Screen
Job for mariadb.service failed because the control process exited with error code. See “systemctl status mariadb.service” and “journalctl -xe” for details.
DB query failed: SQLSTATE[HY000] [2002] No such file or directory
The server is running on CentOS, and we are connecting via SSH.
Open the MySQL configuration file by running:
vi /etc/my.cnf
Add the following line to the my.cnf file:
open_files_limit = 1024000
Save the changes and restart the MySQL service:
systemctl restart mysql
Alternatively, you can reboot the server if restarting the service doesn’t work:
reboot
This resolved the issue for us.