10

I got a mysql error after the update of it.

This is the log.

(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

If some one can help. I have try to remove mysql server and it tells me this.

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

ADDED ENGLISH TRANSLATION TO LOG FILE:

(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
1
  • Added a Translation to English this time. Try to place a English version in future as it will attract more responses. You can translate them using Google Translate translate.google.com/#auto/en Aug 14, 2012 at 18:17

2 Answers 2

14

It seems you have an error in your apparmor profile for mysql. While fixing it, you can disable apparmor profile for mysql and mysql should work:

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

and restart apparmor with: sudo /etc/init.d/apparmor restart

When you have the mysql apparmor profile fixed, you can remove the symlink and restart apparmor.

UPDATE2:

New steps to remove and reinstall 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

(should ask for a new admin password)

Check if it works:

sudo service mysql status

If it doesn't work, check if you have a file /etc/mysql/my.cnf. If not, copy it from the default one and restart mysql:

sudo cp /etc/mysql/my.cnf.dpkg-dist /etc/mysql/my.cnf
10
  • It didn't work.When I do start mysql get the next error paste.ubuntu.com/1147496 start mysql start: Rejected send message, 1 matched rules; type="method_call", sender=":1.93" (uid=1000 pid=32188 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
    – Diego
    Aug 14, 2012 at 19:58
  • you need to start mysql with sudo start mysql. The error you are receiving is the same as when you try to start mysql without sudo (user id = 1000 in the error message).
    – laurent
    Aug 14, 2012 at 20:36
  • It still gives me an error.paste.ubuntu.com/1147618
    – Diego
    Aug 14, 2012 at 21:12
  • If mysql was correctly installed/configured, it should have started now. I would try to remove/reinstall mysql as your first error was during mysql installation and probably it is not installed or configured correctly because it stopped in the middle due to apparmor not allowing it to write somewhere.
    – laurent
    Aug 14, 2012 at 21:52
  • 1
    Good! :) - mysql is not the easiest to reinstall after a failed installation...
    – laurent
    Aug 17, 2012 at 1:11
0

I believe it is related to this issues: https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/375371 https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/227615

I had to change the location of the tmp directory that mysql was using:

Edit /etc/mysql/my.cnf

Change:

tmpdir      = /tmp

To:

tmpdir      = /var/tmp/mysql

And make sure you create that directory and set the permissions appropriately:

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

Then you can try a reinstall and it should work (was fine for me):

sudo apt-get install -f

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .