Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Testing the examples in the book by Charles Bell,Mats Kindahl and Lars Thalmann.I try to check the binlog by using the instruction "SHOW BINLOG EVENTS\G".But it returns "Empty set (0.00 sec)" .Where am I wrong? Here is the my.cnf:

host = localhost
user = jun
password = 111
port = 3306
socket = /var/lib/mysql/mysqld.sock
pid-file = /var/lib/mysql/
basedir = /var/lib/mysql
datadir = /usr
log-bin = /var/log/mysql/master-bin
log-bin-index = /var/log/mysql/master-bin.index
server-id = 1
tmpdir = /tmp

The terminal output below:

mysql> use test1;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from tb1;
| text  |
| YEAH! |
1 row in set (0.00 sec)

mysql> flush logs;
Query OK, 0 rows affected (0.00 sec)

Empty set (0.00 sec)

mysql> exit
juneau@linux-dfxe:~> cd /var/log/mysql/
juneau@linux-dfxe:/var/log/mysql> ll
total 0
share|improve this question
up vote 1 down vote accepted

You need to verify that the bin log file has been created. I think you did not specify the file path correctly.

log-bin = master-bin

Usually, the path should be specified as absolute path such as:

log-bin = /var/log/mysql/master-bin

You need to make sure that mysql user has enough privilege to create/write to this file.

share|improve this answer
Does the path exist or it will be create by this instruction?And the same problem in the index? – NobToJuneau Apr 25 '12 at 12:24
You need to specify existing path with valid permissions. – Khaled Apr 25 '12 at 12:25
It doesn't work.I mkdir mysql in /var/log by su.Restart mysql and try again.It doesn't work – NobToJuneau Apr 25 '12 at 12:29
@NobToJuneau: Can you update your question with the new config and output of ls -l of the new dir. – Khaled Apr 25 '12 at 12:30
:I edited and the result there. – NobToJuneau Apr 25 '12 at 12:36

What user owns /var/log/mysql? What messages are there in the mysql error log? If it is a permissions issue, then mysql will output an error into the log (generally Error 13 if I recall).

share|improve this answer
Well,thx.It's a good advice. – NobToJuneau Apr 27 '12 at 2:42

Your Answer


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.