6

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.

2 Answers 2

7

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 : 120
  • 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

Although the BINLOG magic number is always in the same position, you cannot use binary logs from one version to newer versions under certain circumstances. For example, binary logging events could change and not be understood. Row-based binary logging and MySQL Replication can break on a MySQL 5.6 Slave replicating from an older master when handling DATETIME values. I wrote about this recently

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.

1
  • @RolandoMySQLDBA I believe there's a typo in For MySQL 5.5 : 120 For MySQL 5.5 : 107
    – Carson Ip
    Aug 13, 2018 at 9:28
0

As solution too you can remove mysql-bin.index file.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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