当我这样做时:
mysql -u root -p
并输入my password
,这是我得到的:
ERROR 2002(HY000):无法通过套接字'/var/run/mysqld/mysqld.sock'(2)连接到本地MySQL服务器
所以我输入这个:
systemctl restart mysql
我得到以下错误:
mysql.service的作业失败,因为控制进程退出并显示错误代码。 有关详细信息,请参见“ systemctl状态mysql.service”和“ journalctl -xe”。
所以我做了journalctl -xe
并得到了以下输出:
дек 14 22:57:29 kazak systemd[1]: mysql.service: Failed with result 'exit-code'.
дек 14 22:57:29 kazak systemd[1]: Failed to start MySQL Community Server.
Subject: Unit mysql.service has failed
Defined-By: systemd
Unit mysql.service has failed.
The result is RESULT.
дек 14 22:57:30 kazak systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
дек 14 22:57:30 kazak systemd[1]: mysql.service: Scheduled restart job, restart counter is at 14.
Subject: Automatic restarting of a unit has been scheduled
Defined-By: systemd
所以我这样做了:systemctl status mysql.service
输出是:
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start) since Fri 2018-12-14 22:59:11 +06; 5s ago
Process: 14585 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 4037 (code=exited, status=0/SUCCESS); Control PID: 14594 (mysqld)
Tasks: 14 (limit: 4915)
CGroup: /system.slice/mysql.service
├─14594 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
└─14596 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid`
请问有人知道如何解决吗?