LoginSignup
0
1

More than 5 years have passed since last update.

MySql バイナリログ on Ubuntu

Posted at

How to enable

my.cnf の修正

$ locate my.cnf
/etc/mysql/my.cnf
..
$ sudo diff /etc/mysql/my.cnf /etc/mysql/my.cnf.backup
< log_bin                       = /var/log/mysql/mysql-bin.log  # コメントインする
< expire_logs_days      = 7 # 日付はお好みで。ディスクサイズや保持期間と相談してください
---
> #log_bin                      = /var/log/mysql/mysql-bin.log
> expire_logs_days      = 10

MySQL restart

$ sudo /etc/init.d/mysql restart

How to check

$ which mysqlbinlog # インストールされてるか確認
$ sudo ls -ltr /var/log/mysql/ # 最新のバイナリログを探す
$ sudo mysqlbinlog /var/log/mysql/mysql-bin.000001 # 見る

References

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1