Mysql Êý¾Ý¿âÖÐMysqlbinlogµÄʹÓÃ
ÔÚmy.cnfÕâ¸öÎļþÖмÓÒ»ÐУ¨WindowsΪmy.ini£©¡£
#vi /etc/my.cnf
[mysqld]
log-bin=mysqlbin-log #Ìí¼ÓÕâÒ»ÐоÍokÁË=ºÅºóÃæµÄÃû×Ö×Ô¼º¶¨Òå°É
È»ºóÎÒÃÇ¿ÉÒÔ¶ÔÊý¾Ý¿â×ö¼òµ¥µÄ²Ù×÷ºóµ½mysqlÊý¾ÝÎļþËùÔÚµÄĿ¼À´¿´binlogÎļþ¡£
2. ²é¿´×Ô¼ºµÄBINLOGµÄÃû×ÖÊÇʲô
ÃüÁî:show binary
logs
3. ×öÁ˼¸´Î²Ù×÷ºó£¬Ëü¾Í¼Ç¼ÁËÏÂÀ´¡£
ÃüÁî:show binlog events
4. ÓÃmysqlbinlog ¹¤¾ßÀ´ÏÔʾ¼Ç¼µÄ¶þ½øÖƽá¹û£¬È»ºóµ¼Èëµ½Îı¾Îļþ£¬ÎªÁËÒÔºóµÄ»Ö¸´¡£
Ïêϸ¹ý³ÌÈçÏ£º
C:\Program Files\MySQL\MySQL Server
5.0\bin>mysqlbinlog --start-position=4
--sto
p-position=106 mysqlbin-log.000001 > c:\\test1.txt
»òÕßÈ«²¿µ¼³ö:
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlbinlog mysqlbin-log.000001 > c:\\test1.txt
test1.txtµÄÎļþÄÚÈÝ£º
;
;
DELIMITER ;
# at 4
#110916
# Warning: this binlog was not closed properly. Most probably mysqld crashed writing it.
ROLLBACK;
# at 98
#110916
10:11:21 server id 1
SET INSERT_ID=2;
# at 126
#110916
10:11:21 server id 1
use test;
SET TIMESTAMP=1316139081;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=1344274432;
;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8;
insert into User (name,password) values('ddd','222');
DELIMITER ;
# End of log file
ROLLBACK ;
;
5. µ¼Èë½á¹ûµ½MYSQLÖнøÐÐÊý¾Ý»Ö¸´¡£
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlbinlog --start-position=134 --stop-position=330 mysqlbin-log.000001 | mysql -uroot -p
»òÕß
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqlbinlog --start-position=134 --stop-position=330 mysqlbin-log.000001 >test1.txt
½øÈëMYSQLµ¼Èë
mysql> source c:\\test1.txt
»¹ÓÐÒ»ÖÖ°ì·¨ÊǸù¾ÝÈÕÆÚÀ´»Ö¸´
C:\Program Files\MySQL\MySQL Server 5.0\bin >mysqlbinlog --start-datetime="2009-09-14 0:20:00" --stop-datetim="2009-09-15 01:25:00" /diskb/bin-logs/xxx_db-bin.000001 | mysql -u root
6¡¢²é¿´Êý¾Ý
Select * from User
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ