“Failed to spawn mysql main process: unable to execute: No such file or directory”

1

Check that mysql-server-5.1 package was uninstalled, seems it might persist after upgrade. I had the same error and had to purge MySQL server 5.1 and 5.5 then re-install.

First make a backup of your /var/lib/mysql/ directory just to be safe.

sudo cp -R /var/lib/mysql/ ~/mysql

Next purge MySQL (this will remove php5-mysql and phpmyadmin as well as a number of other libraries so be prepared to re-install some items after this.

sudo apt-get purge mysql-server-5.1 mysql-common

Remove the folder /etc/mysql/ and it's contents

sudo rm /etc/mysql/ -R

Next check that your old database files are still in /var/lib/mysql/ if they are not then copy them back in to the folder then chown root:root

(only run these if the files are no longer there)

sudo mkdir /var/lib/mysql/ sudo chown root:root /var/lib/mysql/ -R sudo cd ~/mysql/ sudo cp * /var/lib/mysql/ -R

Next install mysql server

sudo apt-get install mysql-server

Finally re-install any missing...

0 0
2

by

Daniel

Last Updated September 25, 2017 16:02 PM

For a while I have the problem mentioned in the title. Update is stuck on pre-configuring packages without any other error. I tried almost everything I've found searching Google, but it didn't solve my problem.

btw

sudo apt-get update sudo apt-get autoclean sudo apt-get clean sudo apt-get autoremove sudo apt-get update && sudo apt-get upgrade

is not working. Can somebody please help me fix this issue?

Answers 3

I noticed that a mysql process was starting every time I tried to upgrade and it was eating all of one of my processors. That same process stopped after I stopped the upgrade process. I was unable to determine the cause of that mysql process being stuck so I followed the advice from here: "Failed to spawn mysql main process: unable to execute: No such file or directory".

Then, after running apt-get upgrade it worked without a problem.

Hope this helps.

...

0 0
3

I'm a newbie on MySQL ground so bear with me.

I've just finished upgrading 11.10 to 12.04.

Everything seemed to work without any hiccups and all my software and settings are working fine. Apart from MySQL.

When I try:

sudo start mysql

I receive an error:

start: Job failed to start

Where can I possibly diagnose what the problem is? And (hopefully) - how to sort it out?

(I disabled automatic start following advice here if that is of some importance)

Update 1:

Both outputs of:

cat /var/log/mysql.err cat /var/log/mysql.log

are empty.

Output of dmesg | grep mysql:

[ 1401.785141] type=1400 audit(1335619832.181:25): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=16165 comm="apparmor_parser" [ 1401.791089] init: Failed to spawn mysql main process: unable to execute: No such file or directory

Update 2:

As indicated by AWinter below - it seemed that MySQL disappeared automagically...

0 0
4

For a while I have the problem mentioned in the title. Update is stuck on pre-configuring packages without any other error. I tried almost everything I've found searching Google, but it didn't solve my problem.

btw

sudo apt-get update sudo apt-get autoclean sudo apt-get clean sudo apt-get autoremove sudo apt-get update && sudo apt-get upgrade

is not working. Can somebody please help me fix this issue?

I noticed that a mysql process was starting every time I tried to upgrade and it was eating all of one of my processors. That same process stopped after I stopped the upgrade process. I was unable to determine the cause of that mysql process being stuck so I followed the advice from here: "Failed to spawn mysql main process: unable to execute: No such file or directory".

Then, after running apt-get upgrade it worked without a problem.

Hope this helps.

Cleaning using two ways command. sudo apt-get clean && sudo apt-get update

dpkg...

0 0