ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2021-09-07 15:49:45 CEST; 24min ago
Process: 1020 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
Sep 07 15:49:45 ubuntu systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Sep 07 15:49:45 ubuntu systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Sep 07 15:49:45 ubuntu systemd[1]: Stopped MySQL Community Server.
Sep 07 15:49:45 ubuntu systemd[1]: mysql.service: Start request repeated too quickly.
Sep 07 15:49:45 ubuntu systemd[1]: mysql.service: Failed with result 'exit-code'.
Sep 07 15:49:45 ubuntu systemd[1]: Failed to start MySQL Community Server.
[ ok ] Stopping mysql (via systemctl): mysql.service.
2021-09-07T14:16:38.238483Z mysqld_safe Logging to syslog.
2021-09-07T14:16:38.242249Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2021-09-07T14:16:38.245129Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
-bash: mysql.server: command not found
How to Solve - ERROR 2002 (HY000)