Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I keep getting this error whenever I start MySQL.

121028  1:38:55 [Note] Plugin 'FEDERATED' is disabled.
121028  1:38:55 InnoDB: The InnoDB memory heap is disabled
121028  1:38:55 InnoDB: Mutexes and rw_locks use Windows interlocked functions
121028  1:38:56 InnoDB: Compressed tables use zlib 1.2.3
121028  1:38:56 InnoDB: Initializing buffer pool, size = 16.0M
121028  1:38:56 InnoDB: Completed initialization of buffer pool
121028  1:38:56 InnoDB: highest supported file format is Barracuda.
121028  1:38:57  InnoDB: Waiting for the background threads to start
121028  1:38:58 InnoDB: 1.1.8 started; log sequence number 3137114
121028  1:38:58 [ERROR] Binlog has bad magic number;  It's not a binary log file that can be used by this version of MySQL
121028  1:38:58 [ERROR] Can't init tc log
121028  1:38:58 [ERROR] Aborting

121028  1:38:58  InnoDB: Starting shutdown...
121028  1:38:58  InnoDB: Shutdown completed; log sequence number 3137114
121028  1:38:58 [Note] C:\PROGRA~2\EASYPH~1.1\MySql\bin\mysqld.exe: Shutdown complete

I have already tried this.

I have an EasyPHP 12.1 setup on Windows 7x64 PC.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Binary logs have different start positions upon the creation of a new binary log. In fact, a binary log position actual represents the numbers of bytes written in the binary at the end of the most recent SQL statement recorded.

The following is the list of binary log starting positions for each major release of MySQL 5

  • For MySQL 5.5 : 107
  • For MySQL 5.1 : 106
  • For MySQL 5.0 : 98

Included in these initial bytes is a static value called the magic number, a base-64 value. I wrote about this back on Dec 26, 2011 : mysql emits BINLOG rows even though binlog_­format=­STATEMENT

You cannot use binary logs from one version to a newer or previous version of MySQL because the magic number would most likely be moved over.

There is also the possibility of a corrupt binary log. I wrote about this on Feb 04, 2011 : MySQL master binlog corruption

Your solution is to

  • net stop mysql
  • Erase binary logs (and the binary log index file)
    • IF you do not know where they are, locate my.ini on your PC
    • Open my.ini in Notepad
    • look for the option log-bin or log_bin
    • look for the option datadir
    • If log-bin only has a filename, look inside the folder specified by datadir
    • If log-bin includes a path and a filename, look inside the folder specified by log-bin
    • Open the desired folder in Windows Expolrer
    • Remove the binary logs
    • There should be a file whose file extension is .index. Delete this as well
  • net start mysql

Please DO NOT ERASE ib_logfile0 or ib_logfile1 when you have binary log issues.

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.