无法启动mysql - mysql respawning太快,停了

Modified on: Sat, 09 Jun 2018 21:53:23 +0800

今天我重新安装了ubuntu 12.04并开始设置我的本地开发环境。我安装了mysql并编辑了/etc/mysql/my.cnf来优化InnoDB,但是当我尝试重新启动mysql时,它失败并出现错误:

[20:53][tom@Pochama:/var/www/website] (master) $ sudo service mysql restart
start: Job failed to start

syslog显示init脚本存在问题:

> tail -f /var/log/syslog Apr 28 21:17:46 Pochama kernel: [11840.884524] type=1400 audit(1335644266.033:184): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=760 comm="apparmor_parser" Apr 28 21:17:47 Pochama kernel: [11842.603773] init: mysql main process (764) terminated with status 7 Apr 28 21:17:47 Pochama kernel: [11842.603841] init: mysql main process ended, respawning Apr 28 21:17:48 Pochama kernel: [11842.932462] init: mysql post-start process (765) terminated with status 1 Apr 28 21:17:48 Pochama kernel: [11842.950393] type=1400 audit(1335644268.101:185): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=811 comm="apparmor_parser" Apr 28 21:17:49 Pochama kernel: [11844.656598] init: mysql main process (815) terminated with status 7 Apr 28 21:17:49 Pochama kernel: [11844.656665] init: mysql main process ended, respawning Apr 28 21:17:50 Pochama kernel: [11845.004435] init: mysql post-start process (816) terminated with status 1 Apr 28 21:17:50 Pochama kernel: [11845.021777] type=1400 audit(1335644270.173:186): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=865 comm="apparmor_parser" Apr 28 21:17:51 Pochama kernel: [11846.721982] init: mysql main process (871) terminated with status 7 Apr 28 21:17:51 Pochama kernel: [11846.722001] init: mysql respawning too fast, stopped

有什么想法吗?


我已经尝试过的事情:

我用Google搜索并发现了apparmor的Ubuntu错误(https://bugs.launchpad .net / ubuntu / + source / mysql-5.5 / + bug / 970366),我将apparmor从强制模式更改为抱怨模式:

> tail -f /var/log/syslog

Apr 28 21:17:46 Pochama kernel: [11840.884524] type=1400 audit(1335644266.033:184): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=760 comm="apparmor_parser"
Apr 28 21:17:47 Pochama kernel: [11842.603773] init: mysql main process (764) terminated with status 7
Apr 28 21:17:47 Pochama kernel: [11842.603841] init: mysql main process ended, respawning
Apr 28 21:17:48 Pochama kernel: [11842.932462] init: mysql post-start process (765) terminated with status 1
Apr 28 21:17:48 Pochama kernel: [11842.950393] type=1400 audit(1335644268.101:185): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=811 comm="apparmor_parser"
Apr 28 21:17:49 Pochama kernel: [11844.656598] init: mysql main process (815) terminated with status 7
Apr 28 21:17:49 Pochama kernel: [11844.656665] init: mysql main process ended, respawning
Apr 28 21:17:50 Pochama kernel: [11845.004435] init: mysql post-start process (816) terminated with status 1
Apr 28 21:17:50 Pochama kernel: [11845.021777] type=1400 audit(1335644270.173:186): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=865 comm="apparmor_parser"
Apr 28 21:17:51 Pochama kernel: [11846.721982] init: mysql main process (871) terminated with status 7
Apr 28 21:17:51 Pochama kernel: [11846.722001] init: mysql respawning too fast, stopped

但它没有帮助。我仍然无法启动mysql。

我还认为问题可能是因为InnoDB日志文件的大小与mysql所期望的大小不同。我在重新启动之前删除了innodb日志文件:sudo mv /var/lib/mysql/ib_logfile* /tmp。虽然没有运气。

解决方法:我重新安装了12.04,请确保不要以任何方式触及/etc/mysql/my.cnf。 Mysql正在工作,所以我可以继续我需要做的事情。但是我需要在某些时候对其进行编辑 - 希望我能找到解决方案,否则这个问题就会得到解答......

最佳答案

我终于弄明白了这个问题。基本上,一些参数的定义已从先前版本的mysql中删除,并已被替换为不同的名称。要修复,请在/etc/mysql/my.cnf中替换:

# Tom Added to ensure the server character set is set to utf8
default-character-set = utf8
default-collation     = utf8_general_ci

使用:

# Tom Added to ensure the server character set is set to utf8
character_set_server  = utf8
collation_server      = utf8_general_ci

这是关联的启动板错误报告:https://bugs.launchpad.net /ubuntu/+source/mysql-5.5/+bug/958120

或轻松运行:

# Miraz added dpkg-reconfigure
dpkg-reconfigure mysql-server-5.5

但请确保没有安装旧的mysql版本安装,如果有,请删除:

# Miraz quick mysql package check
dpkg -l *mysql*
作者:user99954,Tom

相关问答

添加新评论