ssh客戶端管理服務器的時候不知道什麼原因卡住了,當時正登錄mysql做鎖表的操作,無法操作於是關掉了客戶端
重新使用putty登錄,登錄mysql,UNLOCK TABLES; 之後使用show slave status\G命令發現同步狀態正常,但其實並沒有進行同步,以爲需要重啓mysql
於是:
[root@localhost ~]# service mysql restart
Shutting down MySQL...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
但mysql一直關不掉,網上搜索了下,可能是什麼進程卡住了
使用命令ps aux | grep mysql 命令將mysql相關的服務搜出來,然後kill掉對應的進程號 |
重新打開一個putty登錄
[root@localhost ~]# ps aux | grep mysql
root 2443 0.0 0.0 202812 2700 pts/0 S+ 08:54 0:00 /www/lnmp/mysql/bin/mysql -u root -p xxxxx
root 3407 0.0 0.0 106416 1812 pts/1 S+ 09:31 0:00 /bin/sh /sbin/service mysql restart
root 3412 0.0 0.0 11300 1420 pts/1 S+ 09:31 0:00 /bin/sh /etc/init.d/mysql stop
root 3421 0.0 0.0 11304 1468 pts/1 S+ 09:31 0:00 /bin/sh /etc/init.d/mysql start
root 5299 0.0 0.0 103244 908 pts/2 S+ 09:44 0:00 grep mysql
聯想到剛纔正是登錄mysql操作的時候卡住了,估計是這個進程
root 2443 0.0 0.0 202812 2700 pts/0 S+ 08:54 0:00 /www/lnmp/mysql/bin/mysql -u root -p xxxxx |
先kill掉它看看
[root@localhost ~]# kill -s 9 2443
剛纔卡住了的那個putty客戶端的mysql馬上正常重啓了
.............................................................................. S UCCESS!
Starting MySQL... SUCCESS!
問題解決