分享更有价值
被信任是一种快乐

怎么使用MySQL bingol

文章页正文上

这篇文章主要讲解了“怎么使用MySQL bingol”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“怎么使用MySQL bingol”吧!1、binlog备份[mysql@mysql5 binlog]$mysqlbinlog –read-from-remote-server –raw –host=192.168.1.210 –port=65535 –user=yang –password=oracle –stop-never –result-file=/mysqldb/backup/backup_192.168.1.210/binlog/ master-bin.0000012、解析binlog[mysql@mysql5 binlog]$ mysqlbinlog -v -v -v master-bin.000007 > 07.txt[mysql@mysql5 binlog]$ vi 07.txt/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;DELIMITER /*!*/;# at 4#180807 11:18:46 server id 6666601 end_log_pos 123 CRC32 0x67606c44 Start: binlog v 4, server v 5.7.23-log created 180807 11:18:46BINLOG ‘lg9pWw9puWUAdwAAAHsAAAAAAAQANS43LjIzLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQAAURsYGc=’/*!*/;# at 123#180807 11:18:46 server id 6666601 end_log_pos 194 CRC32 0xcc8d05b0 Previous-GTIDs# 27b983f4-99ed-11e8-ab5d-000c29e42a1f:1-16# at 194#180807 11:37:34 server id 6666601 end_log_pos 259 CRC32 0x440038b5 GTID last_committed=0 sequence_number=1 rbr_only=noSET @@SESSION.GTID_NEXT= ’27b983f4-99ed-11e8-ab5d-000c29e42a1f:17’/*!*/;…………3、binlog恢复[mysql@mysql5 binlog]$ mysqlbinlog –start-position=161899 –stop-position=323048 –skip-gtids /mysqldb/db_slave/binlog/slave-bin.000001|mysql -uroot -p -S/mysqldb/db_test01/mysql.sock employees实验1、导入employees数据库2、创建表mysql> create table test1 like dept_emp;Query OK, 0 rows affected (0.85 sec)mysql> alter table test1 drop primary key;Query OK, 0 rows affected (0.31 sec)Records: 0 Duplicates: 0 Warnings: 0mysql> insert into test1 select * from dept_emp limit 10000;Query OK, 10000 rows affected (0.16 sec)Records: 10000 Duplicates: 0 Warnings: 03、mysqldump备份employees数据库[mysql@mysql5 db_slave]$ mysqldump -uroot -p -S/mysqldb/db_slave/mysql.sock –master-data=2 –single-transaction –databases employees –set-gtid-purged=off > testdump.sqlEnter password:4、模拟业务mysql> insert into test1 select * from dept_emp limit 10000;Query OK, 10000 rows affected (0.50 sec)Records: 10000 Duplicates: 0 Warnings: 0mysql> delete from test1 limit 1000;Query OK, 1000 rows affected (0.30 sec)mysql> create table test2 like dept_emp;Query OK, 0 rows affected (0.27 sec)5、发现问题进行回滚MASTER_LOG_POS=1免费主机域名61899at 323048[mysql@mysql5 binlog]$ mysqlbinlog -v -v -v slave-bin.000001 > 1.txt[mysql@mysql5 binlog]$ vi 1.txt[mysql@mysql5 db_slave]$ vi testdump.sqlmysql> source /mysqldb/db_slave/testdump.sql #空实例中#[mysql@mysql5 binlog]$ mysqlbinlog –start-position=161899 –stop-position=323048 –skip-gtids /mysqldb/db_slave/binlog/slave-bin.00免费主机域名0001|mysql -uroot -p -S/mysqldb/db_test01/mysql.sock employees5、结果6、导入删除数据[mysql@mysql5 ~]$ mysqldump -uroot -p -S /mysqldb/db_test01/mysql.sock employees test1 –where=”1=1 limit 1000;” –set-gtid-purged=OFF > test3.sqlEnter password:[mysql@mysql5 ~]$ vi test3.sql[mysql@mysql5 ~]$ mysql -uroot -p -S /mysqldb/db_slave/mysql.sock –database=employees –table=test1
mysql: [Warning] mysql: ignoring option ‘–table’ due to invalid value ‘test1’Enter password感谢各位的阅读,以上就是“怎么使用MySQL bingol”的内容了,经过本文的学习后,相信大家对怎么使用MySQL bingol这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是云技术,小编将为大家推送更多相关知识点的文章,欢迎关注!

相关推荐: MySQL 5.6修复从库复制时报错’ERROR 1872 (HY000): Slave failed to initialize’怎么办

这篇文章主要介绍了MySQL 5.6修复从库复制时报错’ERROR 1872 (HY000): Slave failed to initialize’怎么办,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册