log=/mysql/mysql.log
log-error=/mysql/myerr.log
log-bin=/mysql/bin
max_binlog_size=3M
log-slow-queries=/mysql/slow.log
停止 MySQL: [确定]
启动 MySQL: [确定]
[root@zhaoyun mysql]# ls
bin.000001 bin.index myerr.log mysql.log slow.log
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#111202 7:12:16 server id 1 end_log_pos 98 Start: binlog v 4, server v 5.0.77-log created 111202 7:12:16 at startup
# Warning: this binlog was not closed properly. Most probably mysqld crashed writing it.
ROLLBACK/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;这是一个没有执行过sql语句的binlog
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.77-log Source distribution
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
mysql> delete from http;
Query OK, 0 rows affected (0.01 sec)
Bye
[root@zhaoyun mysql]# mysqlbinlog bin.000001
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#111202 7:12:16 server id 1 end_log_pos 98 Start: binlog v 4, server v 5.0.77-log created 111202 7:12:16 at startup
# Warning: this binlog was not closed properly. Most probably mysqld crashed writing it.
ROLLBACK/*!*/;
# at 98
#111202 7:16:04 server id 1 end_log_pos 175 Query thread_id=5 exec_time=0 error_code=0
use ar/*!*/;
SET TIMESTAMP=1322781364/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=33/*!*/;
delete from http
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
可以使用binlog恢复自备份binlog以来的所有操作。