How do I show the binlog_format
on a MySQL server?
And if I dont like it how do I set it to XX permanently?
Where XX is STATEMENT
, ROW
or MIXED
.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityMatt Healy answered the question on how to show/set the format from the mysql client (on a running server) with SET GLOBAL binlog_format = [STATEMENT|ROW|MIXED]
To set the value permanently, and assuming you have access to the my.cnf, add:
[mysqld]
...
binlog_format=XX
...
and then restart your server.
binlog-format=format
Feb 1, 2012 at 19:47
To see the current binlog_format value:
mysql> show variables like 'binlog_format';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| binlog_format | STATEMENT |
+---------------+-----------+
1 row in set (0.00 sec)
To change it:
mysql> SET GLOBAL binlog_format = 'STATEMENT';
mysql> SET GLOBAL binlog_format = 'ROW';
mysql> SET GLOBAL binlog_format = 'MIXED';
Source: http://dev.mysql.com/doc/refman/5.1/en/binary-log-setting.html