Question

I downloaded the source code of MySQL-5.5.34 and compiled it according to the instructions. Then in the /usr/local/mysql/bin folder I did ./mysqld_safe --user=root & The mysql server started and closed immediately.

The /usr/local/mysql/data/p2020rdb.err reads

mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 
The InnoDB memory heap is disabled 
Mutexes and rw_locks use GCC atomic builtins 
Compressed tables use zlib 1.2.8 
    . 
    . 
    . 
    . 
File './mysql-bin.000011' not found ( Errcode: 2) 
Failed to open log (file './mysql-bin.000011', errno 2) 
Could not open log file 
Can't init tc log 
Aborting 

InnoDB: Starting Shutdown + 
InnoDB: Shutdown completed: log sequence number 

I will greatly appreciate any help on this problem.

Was it helpful?

Solution

Basically, MySQL is looking in the mysql-bin.index file and it cannot find the log files that are listed within the index. This will keep MySQL from starting, but the fix is quick and easy. You have two options:

  1. Edit the index file You can edit the mysql-bin.index file in a text editor of your choice and remove the references to any logs which don’t exist on the filesystem any longer. Once you’re done, save the index file and start MySQL.

  2. Take away the index file Move or delete the index file and start MySQL. This will cause MySQL to reset its binary log numbering scheme, so if this is important to you, you may want to choose the previous option.

So how do you prevent this from happening? Use the PURGE MASTER LOGS statement and allow MySQL to delete its logs on its own terms. If you’re concerned about log files piling up, adjust the expire_logs_days variable in your /etc/my.cnf.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top