Mysql每天都会崩溃几次

时间:2014-01-24 23:04:24

标签: mysql linux sockets

我在CentOS 6.5上看到了同样的事情,我在6.4或之前没有看到过。这是MySQL 5.1.71。 在CentOS关闭时,运行的mysqld中的套接字文件不会被清除并保持重新启动状态。

/etc/my.cnf中,我有:

插座=的/ var / lib中/ MySQL的/的mysql.sock

即使ps显示没有运行mysqld,文件/var/lib/mysql/mysql.sock也存在。 我的解决方法是以root身份删除该文件,然后我可以使用

启动mysql

service mysqld start

但是,使用

无法正确清理mysql.sock文件

service mysqld stop

所以它必须与CentOS 6.5关闭或MySQL对它的响应有关。

刚才我又发生了一次撞车事故。这是最后的日志

140124 20:28:07 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:17 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:28:19 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:57:49 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 20:58:06 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:56 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:01:57 [ERROR] /usr/libexec/mysqld: Got an error writing communication packets
140124 21:33:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140124 21:33:42  InnoDB: Initializing buffer pool, size = 8.0M
140124 21:33:42  InnoDB: Completed initialization of buffer pool
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
140124 21:33:42  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
140124 21:33:43  InnoDB: Started; log sequence number 0 16909546
140124 21:33:43 [Note] Event Scheduler: Loaded 0 events
140124 21:33:43 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.71'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution

所以我之前写的如果我删除mysql.sock我可以再次启动mysql,但这是临时解决方案,因为一段时间后它再次崩溃。任何建议如何一劳永逸地解决它?

2 个答案:

答案 0 :(得分:0)

似乎是网络错误。你可以尝试一些事情。 一个是将以下内容添加到my.cnf(试错)

net_write_timeout=120 
max_allowed_packet  

和其他选项是如果你执行大量查询(一个接一个)在两个查询之间放置一个睡眠。

答案 1 :(得分:0)

而不是使用FIFO s使用TCP / IP?

相关问题