goren.ali
By:
goren.ali

Mysql can't be started (start job failed to start error)

September 12, 2014 53.6k views

Hi i can't mysql server. I use Ubuntu 14.04 2 gb droplet

I try:

service mysql start

i get error

start job failed to start

i try this command

this command output:

http://pastebin.com/CC6WMRFc

I see: Unknown/unsupported storage engine: InnoDB

But, WordPress used to InnoDB. How to use InnoDB ?

How to solved? :(

Thank you also sorry for my bad english

Update://

I use this command

dmesg | grep mysql

output this command:

http://pastebin.com/6eTrPbC0

Update 2 ://

I try this command:

mysqladmin status

Output:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
8 Answers

Type df -h to check the free of your disk.

If your disk is full, the mysql cannot start

Looks like your problem has to do with the log files, have you made any changes to Mysql recently?

Try doing this

Inside your Mysql data directory you need to delete this files, don't forget to copy them first to have a backup.

iblogfile0
ib
logfile1
ibdata1

Once that is done, open your my.cnf file usually located at /etc/my.cnf and look for the innodb section and add this to the end of it if is not there yet

innodb_flush_method=normal

You also might want to empty your error log file, finally try restarting mysql again

hope this helps you

  • Thank you. Right now mysql can running again. But, I don't use mysql for wordpress.
    Once again..thank you

    Agung

  • i was same problem of restarting myql.
    i done I found large 6 domain-data.tar.gz files on home/backup folder.

    and i also done following 2 steps :-
    1) Inside var/lib/Mysql deleted this files,:-

    iblogfile0
    iblogfile1
    ibdata1

    2) open my.cnf file added this to the end of it

    innodbflushmethod=normal

    still mysql not restarting. Disk is 1.4GB Free now.

  • Thanks :)
    it helped me and saved me from reinstalling mysql.

I suddenly started having issues with mysql failing and not starting, and was seeing log entries like:
$ dmesg | grep mysql
[ 6.208963] type=1400 audit(1477060722.802:22): apparmor="STATUS" operation="profileload" profile="unconfined" name="/usr/sbin/mysqld" pid=1183 comm="apparmorparser"
[ 6.709699] type=1400 audit(1477060723.302:25): apparmor="STATUS" operation="profilereplace" profile="unconfined" name="/usr/sbin/mysqld" pid=1299 comm="apparmorparser"
[ 6.817714] init: mysql main process (1320) terminated with status 1
[ 6.817729] init: mysql main process ended, respawning
[ 7.803123] init: mysql post-start process (1321) terminated with status 1
[ 7.869587] init: mysql main process (1371) terminated with status 1
[ 7.869603] init: mysql main process ended, respawning
[ 8.856238] init: mysql post-start process (1373) terminated with status 1
[ 8.906902] init: mysql main process (1510) terminated with status 1
[ 8.906917] init: mysql respawning too fast, stopped

I started looking for reasons why apparmor might have gotten involved (found this: http://askubuntu.com/questions/127264/cant-start-mysql-mysql-respawning-too-fast-stopped)

When I started trying to run apt-get commands, THOSE were failing, complaining about tmp files.

Which reminded me that on my web server I'd had previous issues because I was mounting /tmp as a tmpfs and it was (for unknown reasons) getting remounted as read-only, which caused this whole cascade of issues.

SO, if you mount /tmp with tmpfs and other flags for security purposes, it just might be causing other issues as well.

  • Did this fix the issue for you?
    And if it did, what does that mean in practise? I can't even create a new droplet, install MySQL and then issue a sudo service mysql restart without MySQL failing

I had the same issue.

I checked the log with

less /var/log/mysql/error.log

At the bottom of the log I found this

161212  6:30:06  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Error: trying to add tablespace 278 of name './gseworldfilm/wp_wfHoover.ibd'
InnoDB: to the tablespace memory cache, but tablespace
InnoDB: 278 of name './budget_bumps/wp_wfBadLeechers.ibd' already exists in the tablespace
InnoDB: memory cache!

I moved the "/var/lib/mysql/budgetbumps/wpwfBadLeechers.ibd" file to "/var/lib/mysql/budget_bumps"

mv /var/lib/mysql/budget_bumps/wp_wfBadLeechers.ibd /var/lib/mysql/ 

I ran a check and repair to the db

 mysqlcheck -c -uroot  --all-databases
 mysqlcheck -o -uroot  --all-databases
 mysqlcheck -r  -uroot  --all-databases

Then I ran the mysql

service mysql start 

Everything is running fine noe

have you tried turning it off then on again.

Have another answer? Share your knowledge.