1. 程式人生 > >Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/data/VM_0_6_centos.pid)

Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/data/VM_0_6_centos.pid)

剛接觸MySql資料庫,參考一些文章後搭建起來了也建立了資料庫,程式跑到很好,一覺醒來突然連線不上了 MySql資料庫了。

研究了好一會才找到原因。

現象:

登入資料庫失敗

[[email protected]_0_6_centos ~]# mysql -u root -p******
Warning: Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

資料庫服務重啟也失敗

[[email protected]_0_6_centos ~]# /etc/init.d/mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL.... ERROR! The server quit without updating PID file (/usr/local/mysql/data/VM_0_6_centos.pid).

檢視MySql執行緒並殺死

[[email protected]_0_6_centos ~]# ps -ef|grep mysqld
root 803 32742 0 20:45 pts/0 00:00:00 grep --color=auto mysqld

[[email protected]_0_6_centos ~]# kill -9 803
-bash: kill: (803) - No such process
[[email protected]_0_6_centos ~]# kill -9 32742

* SSH connection closed *
* Connection closed *
* Socket connection established *
Last failed login: Tue Nov 6 20:46:12 CST 2018 from 58.218.92.46 on ssh:notty
There were 63 failed login attempts since the last successful login.
Last login: Tue Nov 6 20:43:16 2018 from 119.29.96.147

重啟後還是同樣的問題,檢查MySql日誌 /usr/local/mysql/data/VM_0_6_centos.err

2018-11-06 20:55:02 1764 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable 'lower_case_file_system=1'
2018-11-06 20:55:02 1764 [ERROR] Aborting

才想起來前一晚為解決資料庫大小寫敏感問題在下面兩個檔案添加了lower_case_file_system=1

/usr/local/mysql/my.cnf
/etc/my.cnf.d/mysql-cient.cnf

刪除後重啟service,問題解決!

[[email protected]_0_6_centos ~]# /etc/init.d/mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL. SUCCESS!