Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

MySQL (part of AMPPS) suddenly stopped working. Looking at mysql.err it says it can't start because it cannot find mysql-bin.000006 (error 2).

Here is the full log from mysql.err:

130401 17:00:47 InnoDB: The InnoDB memory heap is disabled
130401 17:00:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130401 17:00:47 InnoDB: Compressed tables use zlib 1.2.3
130401 17:00:47 InnoDB: Initializing buffer pool, size = 128.0M
130401 17:00:47 InnoDB: Completed initialization of buffer pool
130401 17:00:47 InnoDB: highest supported file format is Barracuda.
130401 17:00:49  InnoDB: Waiting for the background threads to start
130401 17:00:50 InnoDB: 1.1.8 started; log sequence number 193114266
/Applications/AMPPS/mysql/bin/mysqld: File './mysql-bin.000006' not found (Errcode: 2)
130401 17:00:50 [ERROR] Failed to open log (file './mysql-bin.000006', errno 2)
130401 17:00:50 [ERROR] Could not open log file
130401 17:00:50 [ERROR] Can't init tc log
130401 17:00:50 [ERROR] Aborting

130401 17:00:50  InnoDB: Starting shutdown...
130401 17:00:50  InnoDB: Shutdown completed; log sequence number 193114266
130401 17:00:50 [Note] /Applications/AMPPS/mysql/bin/mysqld: Shutdown complete

Here is the directory where all the binary log files live:

drwx------  128 cyberskull  admin      4352 Mar 31 02:46 redacted
-rw-rw----    1 cyberskull  admin   5242880 Apr  1 17:00 ib_logfile0
-rw-rw----    1 cyberskull  admin   5242880 Mar 31 02:46 ib_logfile1
-rw-rw----    1 cyberskull  admin  44040192 Apr  1 17:00 ibdata1
drwxr-xr-x@  74 cyberskull  admin      2516 Jan 30 22:31 mysql
-rw-rw----    1 cyberskull  admin   2053929 Mar 18 23:18 mysql-bin.000001
-rw-rw----    1 cyberskull  admin  44002874 Mar 23 19:40 mysql-bin.000002
-rw-rw----    1 cyberskull  admin  25182139 Mar 25 20:59 mysql-bin.000003
-rw-rw----    1 cyberskull  admin  21533910 Mar 28 19:51 mysql-bin.000004
-rw-rw----    1 cyberskull  admin  32820396 Mar 29 18:45 mysql-bin.000005
-rw-rw----    1 cyberskull  admin       114 Mar 30 14:33 mysql-bin.index
-rw-rw----@   1 cyberskull  admin    114303 Apr  1 17:00 mysql.err
drwxr-xr-x@  20 cyberskull  admin       680 Jan 30 22:31 performance_schema
drwxr-xr-x@   2 cyberskull  admin        68 Jan 30 22:31 test

What do I have to do to get MySQL up and running again?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

OPTION #1

Just move the binary logs aside and start mysql

mv mysql-bin.* ..

Then, startup mysql

OPTION #2

Edit the file mysql-bin.index and remove the line that has mysql-bin.0000006

Then, startup mysql

Give it a Try !!!

share|improve this answer
    
Removing the last line from the log file seems to fix the issue. –  CyberSkull May 2 '13 at 21:09
add comment

You have two options:

  1. Rename mysql-bin.index to mysql-bin.old. This way it can't find the file, but you still have it if you need it.

  2. Enter the following command:

    cp mysql-bin.000002 mysql-bin.000006
    

    Optionally after that you can change the date and time to whatever you want when running this command:

    PURGE BINARY LOGS BEFORE '2013-03-14 10:00:00';
    
share|improve this answer
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.