IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

mysql主从复制replication的一些相关命令

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

85_1.png

主服务器上的相关命令:
show master status;

mysql> show master status\G
*************************** 1. row ***************************
             File: host2-bin.000002
         Position: 420
     Binlog_Do_DB: 
 Binlog_Ignore_DB: 
Executed_Gtid_Set: 5abd564e-2b4f-11e5-a7f1-000c2954ccde:1,
780aa541-2b93-11e5-a9ad-000c29ef36a8:1
1 row in set (0.00 sec)

show slave hosts;

mysql> show slave hosts;
+
| Server_id | Host            | Port | Master_id | Slave_UUID                           |
+
|         1 | 192.168.203.133 | 3306 |         2 | 780aa541-2b93-11e5-a9ad-000c29ef36a8 |
|         3 | 192.168.203.134 | 3306 |         2 | 5abd564e-2b4f-11e5-a7f1-000c2954ccde |
+
2 rows in set (0.00 sec)

show binary logs;

mysql> show binary logs;
+
| Log_name         | File_size |
+
| host2-bin.000001 |       413 |
| host2-bin.000002 |       420 |
+
2 rows in set (0.00 sec)

show binlog events;

mysql> show binlog events;
+
| Log_name         | Pos | Event_type     | Server_id | End_log_pos | Info                                                              |
+
| host2-bin.000001 |   4 | Format_desc    |         2 |         120 | Server ver: 5.6.16-log, Binlog ver: 4                             |
| host2-bin.000001 | 120 | Previous_gtids |         2 |         151 |                                                                   |
| host2-bin.000001 | 151 | Gtid           |         1 |         199 | SET @@SESSION.GTID_NEXT= '780aa541-2b93-11e5-a9ad-000c29ef36a8:1' |
| host2-bin.000001 | 199 | Query          |         1 |         262 | BEGIN                                                             |
| host2-bin.000001 | 262 | Table_map      |         1 |         309 | table_id: 70 (testdb.t1)                                          |
| host2-bin.000001 | 309 | Delete_rows    |         1 |         359 | table_id: 70 flags: STMT_END_F                                    |
| host2-bin.000001 | 359 | Xid            |         1 |         390 | COMMIT                                               |
| host2-bin.000001 | 390 | Stop           |         2 |         413 |                                                                   |
+
8 rows in set (0.00 sec)

下面这几个是删除二进制相关的,不作演示,具体可以搜索一下用法:

purge logs to ‘log_name’;
purge logs before ‘date’;
reset master;(老版本flush master)
set sql_log_bin=

从服务器上的相关命令:
slave start
slave stop
SLAVE STOP IO_THREAD //此线程把master段的日志写到本地
SLAVE start IO_THREAD
SLAVE STOP SQL_THREAD //此线程把写到本地的日志应用于数据库
SLAVE start SQL_THREAD
reset slave
SET GLOBAL SQL_SLAVE_SKIP_COUNTER
load data from master
show slave status(SUPER,REPLICATION CLIENT)
CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,MASTER_USER=, MASTER_PASSWORD= //动态改变master信息
PURGE MASTER [before ‘date’] 删除master端已同步过的日志


Warning: A non-numeric value encountered in /data/wangzhan/tech.souyunku.com.wp/wp-content/themes/dux/functions-theme.php on line 1154
赞(97) 打赏



未经允许不得转载:搜云库技术团队 » mysql主从复制replication的一些相关命令

IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码
IDEA2023.1.3破解,IDEA破解,IDEA 2023.1破解,最新IDEA激活码

评论 抢沙发

大前端WP主题 更专业 更方便

联系我们联系我们

觉得文章有用就打赏一下文章作者

微信扫一扫打赏

微信扫一扫打赏


Fatal error: Uncaught Exception: Cache directory not writable. Comet Cache needs this directory please: `/data/wangzhan/tech.souyunku.com.wp/wp-content/cache/comet-cache/cache/https/tech-souyunku-com/index.q`. Set permissions to `755` or higher; `777` might be needed in some cases. in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php:367 Stack trace: #0 [internal function]: WebSharks\CometCache\Classes\AdvancedCache->outputBufferCallbackHandler() #1 /data/wangzhan/tech.souyunku.com.wp/wp-includes/functions.php(5109): ob_end_flush() #2 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(303): wp_ob_end_flush_all() #3 /data/wangzhan/tech.souyunku.com.wp/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #4 /data/wangzhan/tech.souyunku.com.wp/wp-includes/plugin.php(470): WP_Hook->do_action() #5 /data/wangzhan/tech.souyunku.com.wp/wp-includes/load.php(1097): do_action() #6 [internal function]: shutdown_action_hook() #7 {main} thrown in /data/wangzhan/tech.souyunku.com.wp/wp-content/plugins/comet-cache/src/includes/traits/Ac/ObUtils.php on line 367