1.路径
/etc/mysql/my.cnf
2.去掉log_bin的注释
log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M
3.重启mysql
service mysql restart
4.生成文件
/var/log/mysqlmysql-bin.000001
mysqlbinlog可用于数据库被误删后的恢复
1.路径
/etc/mysql/my.cnf
2.去掉log_bin的注释
log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M
3.重启mysql
service mysql restart
4.生成文件
/var/log/mysqlmysql-bin.000001
mysqlbinlog可用于数据库被误删后的恢复