我已经在机器上安装了Ubuntu 10.04 LTS作为LAMP服务器。 每隔一段时间,我的MySQL连接就会消失,我得到这个错误消息:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
之后,我不得不重新启动我的服务器,让它再次工作。
这似乎没有警告发生。 debugging这个问题的最好方法是什么? 我对命令行Linux相当陌生,所以请温和。
编辑:在查看MySQL日志,这是我发现:
100813 18:56:16 [Note] Plugin 'FEDERATED' is disabled. 100813 18:56:16 InnoDB: Started; log sequence number 0 44233 100813 18:56:16 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. The table is probably corrupted 100813 18:56:16 [ERROR] mysql.user has no `Event_priv` column at position 29 100813 18:56:16 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler. 100813 18:56:16 [Note] /usr/sbin/mysqld: ready for connections. Version: '5.1.41-3ubuntu12' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu) 100813 18:56:17 - mysqld got signal 11 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail.
看起来像你的MySQL服务器粉碎和删除套接字,看看在MySQL服务器日志应该指出什么问题。
编辑:
好吧,这表明您的用户表已损坏,请尝试修复它
mysql use mysql repair table user