1. 程式人生 > >關於無法開啟mysqld的說明-網上找到教程的

關於無法開啟mysqld的說明-網上找到教程的

mysql linux

開機之後,發現無法登陸mysql

[root@localhost ~]# mysql -hlocalhost -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (111)

查看mysql狀態,沒有起來
[root@localhost ~]# systemctl status mysqld

● mysqld.service - SYSV: MySQL database server.
Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since 一 2018-05-07 18:55:45 CST; 3min 10s ago
Docs: man:systemd-sysv-generator(8)
Process: 995 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=1/FAILURE)

5月 07 18:55:37 localhost.localdomain systemd[1]: Starting SYSV: MySQL database server....
5月 07 18:55:45 localhost.localdomain mysqld[995]: MySQL Daemon failed to start.
5月 07 18:55:45 localhost.localdomain mysqld[995]: Starting mysqld: [失敗]
5月 07 18:55:45 localhost.localdomain systemd[1]: mysqld.service: control process exited, code=exite...s=1

5月 07 18:55:45 localhost.localdomain systemd[1]: Failed to start SYSV: MySQL database server..
5月 07 18:55:45 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
5月 07 18:55:45 localhost.localdomain systemd[1]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

[root@localhost run]# mkdir -p /var/run/mysqld
[root@localhost run]# chown mysql.mysql mysqld
[root@localhost run]# systemctl start mysqld
開啟成功!

關於無法開啟mysqld的說明-網上找到教程的