Friday, November 9, 2012

MySQL Binlog problem

I don't know what happened but when I started my wamp server, it does not turn my wamp icon to full white. I stops at being 1/3 in yellow. But last time I opened my wamp, it was perfectly ok. Weird, so I started to look for solutions to fix this.


Most of the sites keeps on telling me that it's because of skype. But I don't have skype installed, so its out already. Some says it's database problem, I tried accessing my phpmyadmin, and yes, it's not working. I started to look at my log files, specifically log generated by mysql. Here's the error i got:

121105 18:18:48 [Note] Plugin 'FEDERATED' is disabled.
121105 18:18:49  InnoDB: Started; log sequence number 0 10118681
121105 18:18:49 [ERROR] Binlog has bad magic number;  It's not a binary log file that can be used by this version of MySQL
121105 18:18:49 [ERROR] Can't init tc log
121105 18:18:49 [ERROR] Aborting
I started searching for the Binlog error. Some suggested to just reinstall wamp and install again. Seriously guys, if you find an error, you just resort to reinstalling? Quick Fix, but, that should be last resort. Hunting for the real problem is more enlightening than re-installing.

I bumped into this site, DBA Stackexchange, and behold, my golden answers are written here. I followed the instructions stated here. Please DO NOT ERASE ib_logfile0 or ib_logfile1 when you have binary log issues.
  • 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. If you're using Wamp, left click the icon > MySQL > Click my.ini
  • Look for the option log-bin or log_bin; Then 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 filepath. In my case, I opened the folder C:\wamp\bin\mysql\mysql5.1.36\data
  • Remove the binary logs
  • There should be a file whose file extension is .index. Delete this as well
  • Restart mysql, or restart Wamp Services
I did not find the binary logs, but, when I deleted mysql-bin.index and restarted my Wamp Service, it did the trick.
Hopefully this helps to others as well.

No comments:

Post a Comment