0

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> 

2 Answers 2

1

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.

6
  • Does the path exist or it will be create by this instruction?And the same problem in the index? Apr 25, 2012 at 12:24
  • You need to specify existing path with valid permissions.
    – Khaled
    Apr 25, 2012 at 12:25
  • It doesn't work.I mkdir mysql in /var/log by su.Restart mysql and try again.It doesn't work Apr 25, 2012 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, 2012 at 12:30
  • :I edited and the result there. Apr 25, 2012 at 12:36
0

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).

1
  • Well,thx.It's a good advice. Apr 27, 2012 at 2:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .