尝试停止其服务时出现MySQL-Linux错误 [英] MySQL-Linux error when attempting to stop its service

查看:110
本文介绍了尝试停止其服务时出现MySQL-Linux错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在尝试停止机器上的MySQL服务器时收到的消息:

This is the message I got when I was trying to stop a MySQL server on my machine:

MySQL manager or server PID file could not be found

我执行的命令:

service mysql stop

/etc/init.d/mysqld stop

我也尝试启动MySQL服务器,但出现以下错误

I also attempted to start the MySQL server, but I got the following error

Starting MySQL.Manager of pid-file quit without updating file

我无法访问MySQL数据库.

I cannot access MySQL database.

要指出的几点:

  1. 我在/etc/my.cnf下有my.cnf文件
  2. ps -ef |grep mysql不显示任何进程
  3. /var/run/mysqld/为空(没有mysql.pid文件)
  4. /tmp/mysql.sock不存在
  1. I have the my.cnf file under /etc/my.cnf
  2. ps -ef |grep mysql does not display any processes
  3. /var/run/mysqld/ is empty (no mysql.pid file)
  4. /tmp/mysql.sock does not exist

我读了文件/var/log/mysqld.log,似乎mysql试图进行崩溃恢复.昨天可能会关闭,但那是我无法控制的.我只想找回数据库.有什么专家可以帮助我吗?我拥有这台机器的sudo帐户,但除非是最后一个选项,否则我不会重新启动这台机器,因为这是其他人使用的服务器.

I read the file /var/log/mysqld.log and it seemed that mysql was trying to do some crash recovery. There could be a shutdown yesterday but it was out of my control. I just want to get the database back. Can any expert help me? I have the sudo account of this machine but I would not reboot this machine unless it is the last option because it is a server used by other people.

推荐答案

我在搜索google的前4页并尝试了所有建议的内容(修复表,移动my.cnf,清除锁,重新启动等)后,遇到了相同的错误)无效.原来是因为我手动清除了一些旧的二进制日志(binary.00001,binary.00002等),但是我没有更新binary.index文件来匹配.我从binary.index删除了相应的行,就可以了.

I was getting the same error and after searching the first 4 pages of google and trying everything suggested (repairing tables, moving my.cnf, clearing locks, rebooting etc) nothing worked. It turned out that it was because I had manually cleared some old binary logs (binary.00001, binary.00002 etc) but i hadn't updated the binary.index file to match. I deleted the appropriate lines from binary.index and it just worked.

这篇关于尝试停止其服务时出现MySQL-Linux错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆