Skip to main content
Question

SQLSTATE[HY000] [2002] No such file or directory

  • March 8, 2023
  • 10 replies
  • 1591 views

Forum|alt.badge.img+3

Good morning,

I have a problem with my Centreon VM this morning when I arrived I had this error: SQLSTATE[HY000] [2002] No such file or directory.

Installing the VM This is the Appliance provided by centreon 22.04

 

10 replies

lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • March 8, 2023

Hi @mael35 can you check the status of MariaDB using following command:

systemctl status mariadb

 


Forum|alt.badge.img+3
  • Author
  • Steward **
  • March 20, 2023

[root@srv-centreon ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.5.15 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─centreon.conf, migrated-from-my.cnf-settings.conf
   Active: failed (Result: exit-code) since Sun 2023-03-19 00:12:35 CET; 1 day 9h ago
     Docs: man:mariadbd(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 2922500 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 2922463 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, sta>
  Process: 2922461 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 2922500 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
 


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • March 20, 2023

Can you validate that this file exists: /var/lib/mysql/mysql.sock

ls -lah /var/lib/mysql/mysql.sock

 


Forum|alt.badge.img+3
  • Author
  • Steward **
  • March 20, 2023

Yes he is present


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • March 20, 2023

So I d’ont understand why PHP can’t connect to MariaDB.

Can you try:

systemctl restart php-fpm mariadb

Then refresh the page in the browser


Forum|alt.badge.img+3
  • Author
  • Steward **
  • April 3, 2023

systemctl restart php-fpm mariadb
Job for mariadb.service failed because a fatal signal was delivered to the control process.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
 


Forum|alt.badge.img+3
  • Author
  • Steward **
  • April 3, 2023

 


lpinsivy
Centreonian
Forum|alt.badge.img+21
  • Centreonian
  • April 3, 2023

So can you execute:

journalctl -xe

or check errors in /var/log/mysql/*.err


Forum|alt.badge.img+3
  • Author
  • Steward **
  • April 3, 2023

I'm very bad in linux so I don't understand all of them, thank you for your help


Forum|alt.badge.img+3
  • Author
  • Steward **
  • April 3, 2023

The problem is storage
  /dev/mapper/almalinux-var_lib_mysql 7.1G 6.9G 183M 98% /var/lib/mysql

But how to resize it?