I tried to reinstall my mysql server on ubuntu 14.

After reinstall all seems to run fun until the service mysql status/start/stop command

When the server is started the mysql status is stop/waiting but it runs (I did added (sudo update-rc.d mysql defaults)).

output of the ps -e | grep mysql

 1897 ?        00:00:00 mysqld_safe
 2650 ?        00:00:05 mysqld

after service mysql start

 1897 ?        00:00:00 mysqld_safe
 2650 ?        00:00:05 mysqld
14392 ?        00:00:00 mysqld

First question: How can I do a clean reinstall of my mysql server/or fix the 2 mysql instances?
Second question: Why is there mysqld_safe and mysqld process, which should run and is needed?

The syslog of start as question here:

Jul 14 09:01:07 myserv kernel: [30516.307340] type=1400 audit(1436857267.353:26): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=12368 comm="apparmor_parser"
Jul 14 09:01:09 myserv /etc/mysql/debian-start[16837]: Upgrading MySQL tables if necessary.
Jul 14 09:01:09 myserv /etc/mysql/debian-start[16842]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Jul 14 09:01:09 myserv /etc/mysql/debian-start[16842]: Looking for 'mysql' as: /usr/bin/mysql
Jul 14 09:01:09 myserv /etc/mysql/debian-start[16842]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Jul 14 09:01:09 myserv /etc/mysql/debian-start[16842]: This installation of MySQL is already upgraded to 5.5.43, use --force if you still need to run mysql_upgrade
Jul 14 09:01:09 myserv /etc/mysql/debian-start[16894]: Checking for insecure root accounts.
Jul 14 09:01:09 myserv /etc/mysql/debian-start[16920]: Triggering myisam-recover for all MyISAM tables

In one window do - tail -f /var/log/syslog

In another window do - service mysql stop

If mysql is still running do pkill mysqld till it's really dead.

Then do - service mysql start

Post syslog entries.

Also post output of the following, so exact software versions are shown.

lsb_release -a dpkg -l | egrep 'mysql|mariadb'

| improve this answer | |
  • service mysql stop says just "stop: Unknown instance: " killing all processes and start over service works but after reboot of the system I will have the same behaviour again that processes are running but service mysql status says stop/waiting.. – Alexander Schranz Jul 14 '15 at 7:30
  • The log which was only outputted when service mysql start I added at the top. – Alexander Schranz Jul 14 '15 at 7:31

I actually have the exact same processes running.

What I did was this...

sudo service mysql stop

Then i found the pid for the rogue mysql processes and killed it...

sudo kill 2650

Now I dont have any mysql processes running. So I started it up again...

sudo service mysql start

Now I have the 2 mysql processes that should be running.

1744 ?        00:00:00 mysqld_safe
2105 ?        00:00:00 mysqld

I have never had any issues with the rogue processes though, so I normally just ignore them. Also since the service didnt stop those processes I assumed it was ok to just kill them. Perhaps someone more knowledgeable can correct me if I am wrong.

| improve this answer | |
  • the problem when I reboot I have the same again. maybe sudo update-rc.d mysql defaults was the false way on my system to add it to the autostart?? – Alexander Schranz Jul 14 '15 at 7:33
  • I didnt need to do that myself, as my install added it for me, however perhaps you have another autostart somewhere. Perhaps removing the service and then rebooting to see if you get a process already started? You can remove the service from autostart using: sudo update-rc.d -f mysql remove – dakka Jul 14 '15 at 7:49
  • when removed from mysql is not started. – Alexander Schranz Jul 14 '15 at 7:52
  • so to clarify removing mysql from autostart and then rebooting results in mysql not starting. Then adding it back in, you get 3 processes started? – dakka Jul 14 '15 at 7:55
  • remove from autostart, reboot system. No sql server ist started. service mysql start will start one process mysqld all works as expected. But on reboot the sql server will not autostart. add to autostart, mysql ist started with 2 processes (mysqld and mysqld_safe) BUT now the problem service mysql status return stop/waiting. when I now run service mysql stop it will return unknown instance (mysql still running). when start there will be 3 processes (2x mysqld and mysqld_safe). – Alexander Schranz Jul 14 '15 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.