由于apparmor配置文件中的错误,mysql无法更新


9

更新后出现了mysql错误。

这是日志。

(Leyendo la base de datos ... 559752 ficheros o directorios instalados actualmente.)
Desinstalando mysql-server ...
Configurando mysql-server-5.5 (5.5.24-0ubuntu0.12.04.1) ...
Error del analizador AppArmor para /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld en la l?nea 40: syntax error, unexpected TOK_END_OF_RULE, expecting TOK_MODE
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error al procesar mysql-server-5.5 (--configure):
 el subproceso instalado el script post-installation devolvió el código de salida de error 1
No se escribió ningún informe «apport» porque ya se ha alcanzado el valor de «MaxReports»
         Se encontraron errores al procesar:
 mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
Un paquete no se pudo instalar. Tratando de recuperarlo:
Configurando mysql-server-5.5 (5.5.24-0ubuntu0.12.04.1) ...
Error del analizador AppArmor para /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld en la l?nea 40: syntax error, unexpected TOK_END_OF_RULE, expecting TOK_MODE
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error al procesar mysql-server-5.5 (--configure):
 el subproceso instalado el script post-installation devolvió el código de salida de error 1
Se encontraron errores al procesar:
 mysql-server-5.5

如果有人可以帮助您。我已经尝试删除mysql服务器,它告诉了我。

Se encontraron errores al procesar:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1

将英语翻译添加到日志文件:

(Reading database ... 559752 files and directories currently installed.)
Removing mysql-server ...
Setting up mysql-server-5.5 (5.5.24-0ubuntu0.12.04.1) ...
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld in the l? Line 40: syntax error, unexpected TOK_END_OF_RULE, expecting TOK_MODE
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
  subprocess installed post-installation script returned error exit code 1
Do not write any report "dumbbell" because it has already reached the value of "MaxReports»
          Errors were encountered while processing:
  mysql-server-5.5
E: Sub-process /usr/bin/dpkg Returned an error code (1)
A package failed to install. Trying to recover:
Setting up mysql-server-5.5 (5.5.24-0ubuntu0.12.04.1) ...
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld in the l? Line 40: syntax error, unexpected TOK_END_OF_RULE, expecting TOK_MODE
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
  subprocess installed post-installation script returned error exit code 1
Errors were encountered while processing:
  mysql-server-5.5

这次添加了英语翻译。将来尝试放置英文版本,因为它将吸引更多的反馈。您可以使用谷歌翻译翻译它们translate.google.com/#auto/en
退出方案

Answers:


13

看来您的apparmor配置文件中存在mysql错误。修复它时,可以为mysql禁用apparmor配置文件,并且mysql应该可以工作:

sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/usr.sbin.mysqld

并使用以下命令重新启动apparmor: sudo /etc/init.d/apparmor restart

修复mysql apparmor配置文件后,可以删除符号链接并重新启动apparmor。

UPDATE2:

删除并重新安装mysql的新步骤:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-client-5.5 mysql-server-5.5
sudo apt-get autoremove
sudo apt-get autoclean

sudo rm -rf /etc/mysql

sudo apt-get install mysql-server mysql-common mysql-client

(应要求一个新的管理员密码)

检查是否有效:

sudo service mysql status

如果不起作用,请检查是否有文件/etc/mysql/my.cnf。如果不是,请从默认目录复制它,然后重新启动mysql:

sudo cp /etc/mysql/my.cnf.dpkg-dist /etc/mysql/my.cnf

它没有用。当我启动mysql时,出现下一个错误paste.ubuntu.com/1147496 start mysql start:拒绝发送消息,匹配1条规则;type =“ method_call”,sender =“:1.93”(uid = 1000 pid = 32188 comm =“ start mysql”)interface =“ com.ubuntu.Upstart0_6.Job” member =“ Start” error name =“(unset)” request_reply =“ 0” destination =“ com.ubuntu.Upstart”(uid = 0 pid = 1 comm =“ / sbin / init”)
迭戈

您需要使用启动MySQL sudo start mysql。您收到的错误与您尝试不使用sudo来启动mysql时的错误相同(错误消息中的用户ID = 1000)。
劳伦特

它仍然给我一个错误。paste.ubuntu.com/1147618
迭戈

如果正确安装/配置了mysql,它应该已经启动。我会尝试删除/重新安装mysql,因为您的第一个错误是在mysql安装期间,并且可能未正确安装或配置mysql,因为由于apparmor不允许它在某处写入,它在中间停止了。
劳伦特(Laurent)2012年

1
好!:)-安装失败后,mysql并非最容易重新安装...
laurent 2012年

0

我相信这与以下问题有关:https : //bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/375371 https://bugs.launchpad.net/ubuntu/+source/mysql -dfsg-5.0 / + bug / 227615

我必须更改mysql使用的tmp目录的位置:

编辑/etc/mysql/my.cnf

更改:

tmpdir      = /tmp

至:

tmpdir      = /var/tmp/mysql

并确保您创建该目录并适当设置权限:

sudo mkdir -m 0770 /var/tmp/mysql
sudo chown mysql:mysql /var/tmp/mysql

然后,您可以尝试重新安装,它应该可以工作(对我来说很好):

sudo apt-get install -f
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.