-1

I'm new to the server configurations. I have a website hosted on an ubuntu server. The website tells me that it can't connect to the database. I logged in to the server and typed mysql and I get the following error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I also did sudo service mysql status and I get the following error

mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2022-06-10 15:46:54 CEST; 8min ago
    Process: 1400808 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 1400816 ExecStart=/usr/sbin/mysqld (code=exited, status=2)
   Main PID: 1400816 (code=exited, status=2)
     Status: "Server is operational"

Jun 10 15:46:54 vm40565 systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Jun 10 15:46:54 vm40565 systemd[1]: Stopped MySQL Community Server.
Jun 10 15:46:54 vm40565 systemd[1]: mysql.service: Start request repeated too quickly.
Jun 10 15:46:54 vm40565 systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 10 15:46:54 vm40565 systemd[1]: Failed to start MySQL Community Server.

I tried multiple solutions from Stack Overflow but nothing works, I always get the ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Error.

The error logs show me the following: https://prnt.sc/-D856iDA3ntJ

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.