mysql ERROR 2002 (HY000)错误解决方法
Tofloor
poster avatar
159******10
deepin
2017-10-31 17:33
Author
本帖最后由 shooke 于 2017-10-31 09:35 编辑

昨天关机的时候报了一串错误,就预感可能某个程序会出问题,果然,今天启动又出现了
busybox v1.22.1(debian 1:1.22.0-19) built-in shell(ash)


开机后mysql启动不了了。
用mysql -u root 链接数据库报错
  1. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Copy the Code

到了/var/run/mysqld下查看果然没有mysqld.sock。
于是去/var/log/mysql下看了error.log,日志里发现了这样的错误
  1. [ERROR] Plugin 'InnoDB' init function returned error.
  2. [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Copy the Code

从网上查资料,发现需要删除几个库文件。到/var/lib/mysql下发现有ib_logfile0,ib_logfile1。
果断删除
  1. sudo rm -rf /var/lib/mysql/ib_logfile*
Copy the Code

重新启动mysql成功。


Reply Favorite View the author
All Replies
avatar
cosven
deepin
2017-10-31 19:55
#1
挺好的
不过这样可能会丢数据把
Reply View the author
avatar
159******10
deepin
2017-10-31 20:51
#2
https://bbs.deepin.org/post/147491
挺好的
不过这样可能会丢数据把

不会丢数据,数据是在data里的
Reply View the author