错误 2002 (HY000):无法通过套接字“/var/run/mysqld/mysqld.sock”连接到本地 MySQL 服务器

时间:2021-04-14 03:12:04

标签: mysql ubuntu pam-unix

好的,突然之间 sql 在我的服务器上无法正常工作。当我运行 sudo service mysql start 时,它说:

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

当我运行 systemctl status mysql.service 时,它显示:

mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start) since Wed 2021-04-14 03:08:17 UTC; 4s ago
Process: 12884 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 12892 (mysqld)
Status: "Server startup in progress"
Tasks: 2 (limit: 1136)
Memory: 2.7M
CGroup: /system.slice/mysql.service
         └─12892 [mysqld]

当我运行 journalctl -xe 时显示:

Apr 14 03:04:43 otzivio-ubuntu-s-1vcpu-1gb-intel-fra1-01 sudo[11492]: pam_unix(sudo:auth): 
authentication failure; logname=ashok uid=1000 euid=0 tty=/dev/pts/0 ruser=ashok rhost=  user=ashok
Apr 14 03:04:47 otzivio-ubuntu-s-1vcpu-1gb-intel-fra1-01 sudo[11492]: pam_unix(sudo:auth): 
conversation failed
Apr 14 03:04:47 otzivio-ubuntu-s-1vcpu-1gb-intel-fra1-01 sudo[11492]: pam_unix(sudo:auth): auth could 
not identify password for [ashok]
Apr 14 03:05:20 otzivio-ubuntu-s-1vcpu-1gb-intel-fra1-01 sudo[11748]: pam_unix(sudo:auth): 
authentication failure; logname=ashok uid=1000 euid=0 tty=/dev/pts/0 ruser=ashok rhost=  user=ashok

感谢任何帮助

1 个答案:

答案 0 :(得分:0)

首先运行“sudo apt-get install -f”来解决依赖问题,如果它不起作用,请检查您的配置文件、权限等。尝试查看是否发生了任何更新。

在最后一种情况下,什么都不起作用。尝试通过“sudo apt-get autoremove mysql-server && apt-get install mysql-server”重新安装,但请确保您拥有所有备份操作系统配置文件和 sql...

我不知道它是否真的有帮助,但在我的工作中,我们从晚上到白天在服务器中收到一些更新,这些更新都拉低了 kkk。经过一些糟糕的经历后,我每天都会创建备份的备份...