Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

[mysqld]
host = localhost
user = jun
password = 111
port = 3306
socket = /var/lib/mysql/mysqld.sock
pid-file = /var/lib/mysql/mysqld.pid
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)

mysql> SHOW BINLOG EVENTS\G
Empty set (0.00 sec)

mysql> exit
Bye
juneau@linux-dfxe:~> cd /var/log/mysql/
juneau@linux-dfxe:/var/log/mysql> ll
total 0
juneau@linux-dfxe:/var/log/mysql> 
share|improve this question

2 Answers 2

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

 
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.