本地连接远程mysql服务报错:MySQL is running but PID file could not be found [FAILED]

错误:
本地连接远程mysql服务报错:MySQL is running but PID file could not be found [FAILED]_第1张图片

去服务器查看mysql运行状态:

service mysqld status

报错日志:

MySQL is running but PID file could not be found           [FAILED]

mysql运行了但是没有找到PID文件

本地sqlyog连接报错日志:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

重启mysql服务:

service mysqld restart

停止mysql服务:

service mysqld stop

都是这个错误:

MySQL is running but PID file could not be found           [FAILED]

我不能忍,我也就是几天没玩这个服务器,都弄个这事,然后就在网上扒拉扒拉,总结如下:

第一步:找到mysql-bin.index文件

[root@yixiujun mysql]# find / -name mysql-bin.index;

第二步:删mysql-bin.index文件

[root@yixiujun mysql]# rm -rf /www/server/data/mysql-bin.index;

//这个路径是你的服务器上查询出来的
/www/server/data/mysql-bin.index;  

第三步:找到所有有关mysql的进程

[root@yixiujun mysql]# ps -aux | grep mysql;

本地连接远程mysql服务报错:MySQL is running but PID file could not be found [FAILED]_第2张图片
第四步:kill杀进程(能杀的都杀了)

[root@yixiujun mysql]# kill 1469;
[root@yixiujun mysql]# kill 2164;
[root@yixiujun mysql]# kill 65550;
[root@yixiujun mysql]# kill 66807;

杀完再检查一下:

[root@yixiujun mysql]# ps -aux | grep mysql;
//下面这个杀不掉不用管
root     1915167  0.0  0.0  12132  1072 pts/0    S+   10:38   0:00 grep --color=auto mysql

第五步:再次查看mysql运行状态:

[root@yixiujun mysql]# service mysqld status;

不出意外会出现下面这个玩意:

MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]

第六步:发现有一个系统文件被锁了,进入上述路径/var/lock/subsys,把mysql文件删了:

[root@yixiujun subsys]# rm -rf ./mysql;

第七步:再次查看mysql运行状态

[root@yixiujun subsys]# service mysqld status
MySQL is not running                                       [FAILED]

耶,对比一下上述出现的日志:

//现在
MySQL is not running                                       [FAILED]

//上述
MySQL is running but PID file could not be found           [FAILED]

这说明啥,说明pid进程文件找到了!那这个时候咱们再看看咋样了!

第八步:启动一下msql

[root@yixiujun subsys]# service mysqld start;
Starting MySQL..                                           [  OK  ]

看到这个[OK],启动成功,内心真的很哇塞!!!

本地连接远程mysql服务报错:MySQL is running but PID file could not be found [FAILED]_第3张图片


扩展:

如果忘记了登录密码看下文:
连接MySQL出现错误:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)

你可能感兴趣的:(踩坑,mysql,服务器,数据库,阿里云)