Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am completely stumped right now, whilst I am not an advanced user, I know my way around Ubuntu and so tried to look into things with the help of certain forum topics.

The Problem: Today, quite randomly, mysql stopped working on my local laptop. I could no longer get the service to start up either

$ sudo mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111

So after a lot of searching and checking file permissions as other posts have suggested I decided enough was enough and went for the complete reinstall of mysql. This also didn't work. And so I found this post to go for a complete purge: MySQL fails to start (After upgrade, installation, etc..)

Again no luck, and a lot of other posts I found either have solutions which haven't worked for me, or do not have any solution at all. Not really sure what to try next, or whether this is a common issue others are having. Any suggestions on tests I can run would be most appreciated to resolve this as I could really do with having mysql back and working again.

The current errors I get when I go to reinstall mysql are:

Setting up mysql-client-5.5 (5.5.31-0ubuntu0.13.04.1) ...
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
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 status 1
Processing triggers for libc-bin ...
No apport report written because MaxReports has already been reached
                                                                ldconfig deferred processing now taking place
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.31-0ubuntu0.13.04.1) ...
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 status 1
Errors were encountered while processing:
 mysql-server-5.5

So it's implying an issue with mysql-server-5.5 but not sure what or why, as this should be completely fresh.

Thanks for any time and/or advice you can give, Dan

Update1 Found a new post with a new idea, no luck, but more error information potentially to help debug this

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
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 status 1
Errors were encountered while processing:
 mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

Update2 Results of the error.log in mysql

$ tail /var/log/mysql/error.log
/usr/sbin/mysqld(+0x59043a)[0xb745943a]
/usr/sbin/mysqld(+0x590cd3)[0xb7459cd3]
/usr/sbin/mysqld(+0x585fea)[0xb744efea]
/usr/sbin/mysqld(+0x4c57b9)[0xb738e7b9]
/usr/sbin/mysqld(+0x4b785e)[0xb738085e]
/usr/sbin/mysqld(+0x4ba8f1)[0xb73838f1]
/lib/i386-linux-gnu/libpthread.so.0(+0x6d78)[0xb6e78d78]
/lib/i386-linux-gnu/libc.so.6(clone+0x5e)[0xb6c083de]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
retrobadger@Laptop-Badger:~$ tail -n50 /var/log/mysql/error.log
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
130509 11:30:18  InnoDB: Assertion failure in thread 2792295232 in file fsp0fsp.c line 3309
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
10:30:18 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346064 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x33)[0xb72ea683]
/usr/sbin/mysqld(handle_fatal_signal+0x48c)[0xb71af2fc]
[0xb6ea6400]
/usr/sbin/mysqld(+0x53c7da)[0xb74057da]
/usr/sbin/mysqld(+0x4ee825)[0xb73b7825]
/usr/sbin/mysqld(+0x4eefcc)[0xb73b7fcc]
/usr/sbin/mysqld(+0x59043a)[0xb745943a]
/usr/sbin/mysqld(+0x590cd3)[0xb7459cd3]
/usr/sbin/mysqld(+0x585fea)[0xb744efea]
/usr/sbin/mysqld(+0x4c57b9)[0xb738e7b9]
/usr/sbin/mysqld(+0x4b785e)[0xb738085e]
/usr/sbin/mysqld(+0x4ba8f1)[0xb73838f1]
/lib/i386-linux-gnu/libpthread.so.0(+0x6d78)[0xb6e78d78]
/lib/i386-linux-gnu/libc.so.6(clone+0x5e)[0xb6c083de]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

Update3

May  9 09:51:11 Laptop-Badger mysqld_safe[4193]: 130509  9:51:11  InnoDB: Error: page 11444 log sequence number 7800613976
May  9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: is in the future! Current system log sequence number 7672896206.
May  9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
May  9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: tablespace but not the InnoDB log files. See
May  9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
May  9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: for more information.
share|improve this question
    
I'm not sure, but if you remove mysql-server, do your config files get removed? because if the config file is broken, the server won't start, and you'd get this (because the error is that the 'start' action of the service doesn't work). I'd suggest apt-get rid of it, manually remove (backup!) stuff from /etc, make a real clean install. –  Nanne May 9 '13 at 7:34
    
Sadly that didn't work, the process I ran throu was: apt-get clean, apt-get autoclean, apt-get purge mysql-server*, mv /etc/mysql/ ~/temp/, REBOOT MACHINE, apt-get install mysql-server –  retrodans May 9 '13 at 8:54
2  
did mysql leave any logs in /var/log? any place (dmesg? syslog) where you can find why the startup failed? –  Nanne May 9 '13 at 9:06
    
I couldn't see anything in dmesg when piped through grep for 'mysql', the mysql/error.log did have stuff which I added to initial ticket as update2. Syslog also had notes which I have put into update 3 above –  retrodans May 9 '13 at 10:37
    
it looks like you have innodb databases that can't be recovered? Did you try and remove those? –  Nanne May 9 '13 at 10:39
show 3 more comments

3 Answers 3

up vote 1 down vote accepted

To get a complete answer from the comments above for posterity

There are 2 locations that can stay around after an uninstall

  1. settings in /etc/mysql. If one of the settings is really broken, you might have a problem staring your daemon.
  2. the databases in /var/lib/mysql. If you have a broken database, especially innodb, the start-process will start fixing these. If they can't, you won't be able to start mysql.

Removing both should help you fix any issues.

Mind you that your databases will be gone if you remove /var/lib/mysql and you settings will be gone if you remove /etc/mysql. be sure to understand this

share|improve this answer
add comment

For the record - I had the same error when upgrading to Ubuntu 13.04. Checking the error log said the disk was full.

apt-get clean

freed 700MB &

apt-get -f install

fixed everything up. Hope this saves someone some time. :D

share|improve this answer
add comment

I read: "subprocess installed post-installation script returned error exit status 1"

So, I'd try this: http://raphaelhertzog.com/2011/09/13/understand-dpkg-and-dont-get-stuck-with-a-maintainer-script-failure/

share|improve this answer
    
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  fossfreedom May 10 '13 at 11:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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