Re: log-bin not logging UPDATEs
Posted by:
Johnny Boy
Date: February 15, 2008 02:11AM
This is what I did:
[web] /www> python
Python 2.5.1 (r251:54863, Jan 31 2008, 11:54:32)
[GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> d = MySQLdb.connect("db", "www", "xxxxx")
>>> c = d.cursor()
>>> c.execute("UPDATE database.table SET field=123 WHERE id=12345")
>>> c.execute("COMMIT")
>>> d.commit()
--------------
[db] ~> mysql -h127.0.0.1 -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 97189977
Server version: 5.0.51a-log FreeBSD port: mysql-server-5.0.51a
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select field from database.table where id=12345;
+----------+
| field |
+----------+
| 123 |
+----------+
-------
Then from the slave the change doesn't exist, since it doesn't exist in the log bin either.
And if I do this exact same update from mysql command line, everything works fine.
Same table, same update ("BEGIN; ... ; COMMIT"), same database client, same database server.
I've recompiled MySQLdb and mysql client several times, I just don't get it.
Since the mysql server gets the update and writes it to the table, it should log it too!