Upstart can't start MySQL
Solution 1
Looks like many applications rely on /var/run/utmp
for logon session information.
sudo touch /var/run/utmp
sudo chmod 664 /var/run/utmp
sudo reboot
after the reboot, execute these commands, as @coteyr suggested, to clean install mysql
sudo apt-get purge mysql-server
sudo apt-get update
sudo apt-get install mysql-server
This should resolve your problem.
EDIT:
sudo apt-get purge mysql-server
sudo apt-get purge mysql-common
sudo rm -rf /var/log/mysql
sudo rm -rf /var/log/mysql.*
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
sudo apt-get install mysql-server --fix-missing --fix-broken
This seems to be working for so many people, as per this blog post
Solution 2
The problem is not directly related to MySql. The init daemon control tool is not starting the mysql server daemon into /etc/init
.
You can restore by hand:
sudo initctl reload-configuration
Now mysql server starts as expected.
Solution 3
about the unknown job, mine solved using this
sudo /etc/init.d/mysql start
instead of this
sudo service mysql start
Solution 4
sudo apt-get install mysql-server
Then once it's installed make sure /var/lib/mysql
exists and that /etc/init.d/mysql
exists. /usr/bin/mysqld
and /usr/bin/mysqld_safe
should also exist.
If your still having problems then there's a problem with package (assuming you get no errors there). You can "purge" it, "update" and then "install" the package to see if that clears the error.
sudo apt-get purge mysql-server
sudo apt-get update
sudo apt-get install mysql-server
If that still doesn't work you will need to file a bug with the package maintainers.
Solution 5
This is probably not a tech solution but more a work around. I've tried this and everything else that's making rounds on the internet to fix this problem. Nothing worked. At last I downgraded the packages back to MYSQL 5.29 and it worked like a charm. Thanks.
Ian Hunter
Updated on September 18, 2022Comments
-
Ian Hunter over 1 year
After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ... runlevel:/var/run/utmp: No such file or directory initctl: Unknown job: mysql
sudo service mysql start
gives me anunknown job
error, andmysqld
isn't found on my system.I'm not sure where to go from here, aside from maybe compiling from source and creating my own upstart script. Of course, I'd like to do things the easy way if possible.
How can I successfully run MySQL or fix this problem?
Here is the complete log of what happens when I run the installation command:
sudo apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libaio1 libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-server-5.5 mysql-server-core-5.5 Suggested packages: tinyca mailx The following NEW packages will be installed: libaio1 libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-server mysql-server-5.5 mysql-server-core-5.5 0 upgraded, 11 newly installed, 0 to remove and 13 not upgraded. Need to get 0 B/25.4 MB of archives. After this operation, 88.0 MB of additional disk space will be used. Do you want to continue [Y/n]? Y Preconfiguring packages ... Selecting previously unselected package libaio1:i386. (Reading database ... 159063 files and directories currently installed.) Unpacking libaio1:i386 (from .../libaio1_0.3.109-3_i386.deb) ... Selecting previously unselected package libnet-daemon-perl. Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.48-1_all.deb) ... Selecting previously unselected package libplrpc-perl. Unpacking libplrpc-perl (from .../libplrpc-perl_0.2020-2_all.deb) ... Selecting previously unselected package libdbi-perl. Unpacking libdbi-perl (from .../libdbi-perl_1.622-1_i386.deb) ... Selecting previously unselected package libdbd-mysql-perl. Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.021-1_i386.deb) ... Selecting previously unselected package mysql-client-core-5.5. Unpacking mysql-client-core-5.5 (from .../mysql-client-core-5.5_5.5.31-0ubuntu0.13.04.1_i386.deb) ... Selecting previously unselected package libterm-readkey-perl. Unpacking libterm-readkey-perl (from .../libterm-readkey-perl_2.30-4build4_i386.deb) ... Selecting previously unselected package mysql-client-5.5. Unpacking mysql-client-5.5 (from .../mysql-client-5.5_5.5.31-0ubuntu0.13.04.1_i386.deb) ... Selecting previously unselected package mysql-server-core-5.5. Unpacking mysql-server-core-5.5 (from .../mysql-server-core-5.5_5.5.31-0ubuntu0.13.04.1_i386.deb) ... Selecting previously unselected package mysql-server-5.5. Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.31-0ubuntu0.13.04.1_i386.deb) ... Selecting previously unselected package mysql-server. Unpacking mysql-server (from .../mysql-server_5.5.31-0ubuntu0.13.04.1_all.deb) ... Processing triggers for man-db ... Processing triggers for ureadahead ... Setting up libaio1:i386 (0.3.109-3) ... Setting up libnet-daemon-perl (0.48-1) ... Setting up libplrpc-perl (0.2020-2) ... Setting up libdbi-perl (1.622-1) ... Setting up libdbd-mysql-perl (4.021-1) ... Setting up mysql-client-core-5.5 (5.5.31-0ubuntu0.13.04.1) ... Setting up libterm-readkey-perl (2.30-4build4) ... Setting up mysql-client-5.5 (5.5.31-0ubuntu0.13.04.1) ... Setting up mysql-server-core-5.5 (5.5.31-0ubuntu0.13.04.1) ... Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ... runlevel:/var/run/utmp: No such file or directory initctl: Unknown job: mysql runlevel:/var/run/utmp: No such file or directory initctl: Unknown job: mysql Setting up mysql-server (5.5.31-0ubuntu0.13.04.1) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place
Here are the contents of /var/log/mysql/error.log immediately after the apt-get command is run to install it.
130518 12:14:36 [Note] Plugin 'FEDERATED' is disabled. 130518 12:14:36 InnoDB: The InnoDB memory heap is disabled 130518 12:14:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins 130518 12:14:36 InnoDB: Compressed tables use zlib 1.2.7 130518 12:14:36 InnoDB: Using Linux native AIO 130518 12:14:36 InnoDB: Initializing buffer pool, size = 128.0M 130518 12:14:36 InnoDB: Completed initialization of buffer pool 130518 12:14:36 InnoDB: highest supported file format is Barracuda. 130518 12:14:36 InnoDB: Waiting for the background threads to start 130518 12:14:37 InnoDB: 5.5.31 started; log sequence number 1595675 130518 12:14:37 InnoDB: Starting shutdown... 130518 12:14:38 InnoDB: Shutdown completed; log sequence number 1595675 130518 12:14:38 [Note] Plugin 'FEDERATED' is disabled. 130518 12:14:38 InnoDB: The InnoDB memory heap is disabled 130518 12:14:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins 130518 12:14:38 InnoDB: Compressed tables use zlib 1.2.7 130518 12:14:38 InnoDB: Using Linux native AIO 130518 12:14:38 InnoDB: Initializing buffer pool, size = 128.0M 130518 12:14:38 InnoDB: Completed initialization of buffer pool 130518 12:14:38 InnoDB: highest supported file format is Barracuda. 130518 12:14:38 InnoDB: Waiting for the background threads to start 130518 12:14:39 InnoDB: 5.5.31 started; log sequence number 1595675 ERROR: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AL TER TABLE user ADD column Show_view_priv enum('N','Y') CHARACTER SET utf8 NOT ' at line 1 130518 12:14:39 [ERROR] Aborting 130518 12:14:39 InnoDB: Starting shutdown... 130518 12:14:40 InnoDB: Shutdown completed; log sequence number 1595675 130518 12:14:40 [Note] /usr/sbin/mysqld: Shutdown complete
-
gosalia almost 11 yearsCan you please post the complete log messages, when you do
sudo apt-get install mysql-server
? -
Ian Hunter almost 11 years@thefourtheye Log posted. Hopefully it's helpful. Thanks for your time
-
-
Ian Hunter almost 11 years
/usr/bin/mysqld
does not exist. Purging, updating, and reinstalling did not fix the issue, unfortunately. -
coteyr almost 11 yearspost the complete log as thefourtheeye suggests.
-
Ian Hunter almost 11 yearsThe CLI output should be there now--I'm assuming that's what you're talking about, unless there's some aptitude log I should be pulling from.
-
Ian Hunter almost 11 yearsAfter creating
/var/run/utmp/
, I no longer get the error about it missing. Butinitctl: Unknown job: mysql
is still showing up. -
gosalia almost 11 yearsLook for errors related to mysql or initctl in
/var/log/syslog
-
Ian Hunter almost 11 yearsI have added Google Chrome and Node sources, but that should be it.
-
Ian Hunter almost 11 years
/var/log/syslog
doesn't exist, but I did find/var/log/mysql/error.log
. I've posted its contents in my question. Looks like the same thing as here: gossamer-threads.com/lists/mythtv/mythtvnz/519022 -
gosalia almost 11 yearsUpdated the answer. Please check that
-
Ciro Santilli OurBigBook.com about 10 yearsThe remove everything technique worked for me. Thanks!!!
-
Eric FD about 9 yearsYou forgot to also
rm -rf /var/run/mysqld
, it wouldn't work for me until I also did that. -
David Foerster about 9 yearsOdd… the latter is supposed to be a front-end for the former command.
-
CFrey about 9 yearsyeah it supposed to works, and I don't know if it related to my chromebook linux only
-
Zwi over 8 yearsI had a similar issue, and didn't follow the other instructions...I started with this first because it seemed easiest. And it immediately fixed my issue.