I'm just starting to code and I try to host a Wordpress website on a server of my school. However, as soon as I upload the website on the Wordpress interface with the plugin "all-in-one migration", the database crashed. Wordpress gives me the error :
Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /var/www/html/wordpress/wp-includes/wp-db.php on line 1626
When I check my database, I find it :
● mariadb.service - MariaDB 10.3.22 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: deactivating (final-sigterm) (Result: timeout) since Thu 2020-06-18 21:23:34 UTC; 28min ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Process: 10644 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS) Process: 10645 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 10647 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 Main PID: 10695 (mysqld) Status: "Waiting for page cleaner" Tasks: 3 (limit: 563) Memory: 65.1M CGroup: /system.slice/mariadb.service └─10695 /usr/sbin/mysqld Jun 18 21:23:40 genius systemd: Starting MariaDB 10.3.22 database server... Jun 18 21:23:41 genius mysqld: 2020-06-18 21:23:41 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-0+deb10u1) starting as process 10695 ... Jun 18 21:39:50 genius systemd: mariadb.service: State 'stop-sigterm' timed out. Skipping SIGKILL.
And, of course, when I try to enter my database, I get the code :
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
I tried to restart the database, but it doesn't return any response.
By searching on StackOverflow, a few answers suggest changing localhost to a local IP like 127.0.0.1 in the file "wp-config.php", but it didn't change anything.
Can you help me please ?