MySQL replication problem: ‘show master status’ shows ‘Empty set (0.00 sec)’

In MySQL replication, you setup master and slave MySQL server. On master server, while checking the master status, you might end up with following error message:

1
2
3
4
mysql> SHOW MASTER STATUS;
Empty set (0.00 sec)
mysql> show binary logs;
ERROR 1381 (HY000): You are not using binary logging

The MySQL error log will not provide any help as it will not record any error log.

Solution:

In my case, the problem was due to the binary logs of MySQL. The binary logs either were not enabled or the permission of the binary log file were not correct.

1) Check the log-bin path in my.cnf file:

vi /etc/my.cnf
log-bin=/var/lib/mysql/log-bin.log

and stop MySQL service.

2) Change the ownership and group of "/var/lib/mysql/log-bin.log" to mysql

 chown mysql:mysql  /var/lib/mysql/log-bin.log

and start MySQL service.

3) Login in MySQL prompt and check

mysql> SHOW MASTER STATUS;
+----------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+----------------+----------+--------------+------------------+
| log-bin.000001 | 106 | exampledb | |
+----------------+----------+--------------+------------------+
1 row in set (0.00 sec)

Hope this helps!

Share on Facebook2
Share on Google+3Tweet about this on TwitterShare on StumbleUpon0Share on LinkedIn0Share on Tumblr0Digg thisPin on Pinterest0Share on Reddit0Email this to someonePrint this page

About Abhijit Sandhan

Abhijit Sandhan
Loves Linux, Blogging, Traveling, Hiking and sharing knowledge!

One comment

  1. I try this solution too, but still get "you are not using binary logging"...

    I'm depressing.

    The my.cnf file is ok.

    The permission is ok.

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA