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!
 
 
问题解决