2.11 lnmp架构_MySQL主从复制 一主两从 级联复制

大的平台需要监控,需要自动化

lnmp很大,需要搭建CI/CD

DBA数据库

准备工作

因为3台主机之前做过lnmp架构。所以,这里需要先关闭相关进程,防止内存不足的情况

  • 停止nginx
  • 停止php
  • 启动MySQL

server2的binlog记录的是主库的各种修改更新操作

slave上的I/O线程通过用户名和密码的方式到master去读取binlog
读取到的binlog存放到slave上的中继日志文件relay-log中
中继日志的命名方式为 [server2]-relay

查看延迟的方式:分别查看主库存在的号和从库读取的号是否一致;一致,则说明没有延迟

SQL线程是根据中继日志,转换内容为实际操作,重放到slave主机上

主库是采用多线程,高并发方式进行,而从库只有一个SQL线程。
存在延迟是必然的

一主两从

当前集群中已经部好的节点:一个server1(master),一个server2(slave)

同步新的主机

之前已经部署好一主一从,后期又在集群中同步了数据,
所以,如果现在直接添加节点server3到集群中,后期启动server3的slave,就会出现数据不同步的情况

  • 启动server3
  • 停止httpd
  • 停止memcache

数据如何同步到server3上?

部署新主机上的MySQL

注意,现在server3上没有数据库
不需要在server3上编译MySQL,直接将server1(master)上的相关配置文件拷贝到server3就可以

[root@lnmp1 local]# scp -r mysql/ server3:/usr/local
[root@lnmp1 local]# scp /etc/my.cnf server3:/etc
[root@lnmp1 local]# scp /etc/init.d/mysqld server3:/etc/init.d

(如何将server1的根数据,同步到另一台主机上 —— 使用rsync)

  • server3删除mysql配置目录下的数据目录/usr/local/mysql/data,并修改配置文件/etc/my.cnf中的ID号server-id=3
[root@lnmp3 data]# pwd
/usr/local/mysql/data
[root@lnmp3 data]# rm -fr *
[root@lnmp3 data]# cat /etc/my.cnf
[mysqld]
datadir=/usr/local/mysql/data
socket=/usr/local/mysql/data/mysql.sock
symbolic-links=0
server-id=3
  • 创建mysql用户
  • 一定要保证全平台一致,因为不是rpm包形式的mysql。所以,系统不会自动创建mysql用户;需要我们自己创建
  • 这时,需要注意的是,必须要保证几台主机上的mysql用户ID一致,
  • 否则,可能会出现权限限制的问题
[root@lnmp3 data]# useradd -M -d /usr/local/mysql -s /sbin/nologin mysql
[root@lnmp3 data]# id mysql
uid=1000(mysql) gid=1000(mysql) groups=1000(mysql)
  • 添加环境变量
[root@lnmp3 data]# vim /root/.bash_profile 
[root@lnmp3 data]# source /root/.bash_profile
  • 初始化,生成临时密码
[root@lnmp3 data]# mysqld --initialize --user=mysql
  • 启动数据库
[root@lnmp3 data]# /etc/init.d/mysqld start
Starting MySQL.Logging to '/usr/local/mysql/data/lnmp3.err'.
 SUCCESS! 
  • 密码初始化脚本
[root@lnmp3 data]# mysql_secure_installation 

此时,mysql数据目录中的文件如下:

[root@lnmp3 data]# ll
total 122960
-rw-r----- 1 mysql mysql       56 Jul 11 21:11 auto.cnf
-rw------- 1 mysql mysql     1676 Jul 11 21:11 ca-key.pem
-rw-r--r-- 1 mysql mysql     1112 Jul 11 21:11 ca.pem
-rw-r--r-- 1 mysql mysql     1112 Jul 11 21:11 client-cert.pem
-rw------- 1 mysql mysql     1680 Jul 11 21:11 client-key.pem
-rw-r----- 1 mysql mysql      431 Jul 11 21:11 ib_buffer_pool
-rw-r----- 1 mysql mysql 12582912 Jul 11 21:12 ibdata1
-rw-r----- 1 mysql mysql 50331648 Jul 11 21:12 ib_logfile0
-rw-r----- 1 mysql mysql 50331648 Jul 11 21:11 ib_logfile1
-rw-r----- 1 mysql mysql 12582912 Jul 11 21:12 ibtmp1
-rw-r----- 1 mysql mysql     3729 Jul 11 21:12 lnmp3.err
-rw-r----- 1 mysql mysql        5 Jul 11 21:12 lnmp3.pid
drwxr-x--- 2 mysql mysql     4096 Jul 11 21:11 mysql
srwxrwxrwx 1 mysql mysql        0 Jul 11 21:12 mysql.sock
-rw------- 1 mysql mysql        5 Jul 11 21:12 mysql.sock.lock
drwxr-x--- 2 mysql mysql     8192 Jul 11 21:11 performance_schema
-rw------- 1 mysql mysql     1680 Jul 11 21:11 private_key.pem
-rw-r--r-- 1 mysql mysql      452 Jul 11 21:11 public_key.pem
-rw-r--r-- 1 mysql mysql     1112 Jul 11 21:11 server-cert.pem
-rw------- 1 mysql mysql     1676 Jul 11 21:11 server-key.pem
drwxr-x--- 2 mysql mysql     8192 Jul 11 21:11 sys

添加新主机到MySQL集群

  • 备份集群中的master数据
  • mysqldump 导出指定需要同步的数据库
  • 发送给新节点server3
[root@lnmp1 ~]# mysqldump -uroot -pwestos westos > dump.db
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@lnmp1 ~]# scp dump.db server3:

注意,如果使用mysqldump,要注意一点的是
如果要合并的数据库的表存在,则,合并时,系统会自动删除DROP
所以,一定要查看清除(先删后创建)

[root@lnmp1 ~]# cat dump.db 
-- MySQL dump 10.13  Distrib 5.7.31, for Linux (x86_64)
--
-- Host: localhost    Database: westos
-- ------------------------------------------------------
-- Server version	5.7.31-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `user_tb`
--

DROP TABLE IF EXISTS `user_tb`;		//删除操作
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_tb` (
  `username` varchar(25) NOT NULL,
  `password` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `user_tb`
--

LOCK TABLES `user_tb` WRITE;
/*!40000 ALTER TABLE `user_tb` DISABLE KEYS */;
INSERT INTO `user_tb` VALUES ('yao1','123'),('yao2','123');
/*!40000 ALTER TABLE `user_tb` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2021-07-11 21:14:41
  • 将备份文件导入
[root@lnmp3 data]# mysqladmin create westos -pwestos
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
[root@lnmp3 ~]# mysql -pwestos westos < dump.db
mysql: [Warning] Using a password on the command line interface can be insecure.
  • 此时,数据同步

master

mysql> INSERT  INTO  westos.user_tb VALUES('yao5',123);

slave:

mysql> select * from westos.user_tb;
+----------+----------+
| username | password |
+----------+----------+
| yao1     | 123      |
| yao2     | 123      |
| yao3     | 123      |
| yao4     | 123      |
| yao5     | 123      |
+----------+----------+
5 rows in set (0.00 sec)

【一主两从搭建完毕】

级联复制

实现A -> B -> C

现在master的压力很大,必须做主从复制,该如何做?
一般情况下,slave 需要加上read-only机制,避免数据完整性被破坏
但是现在需要进行级联复制,所以,slave-B不能做read-only机制,因为现在B会作为C的master

  • server2开启二进制日志功能,作为server3的主库
[root@lnmp2 ~]# vim /etc/my.cnf
[mysqld]
datadir=/usr/local/mysql/data
socket=/usr/local/mysql/data/mysql.sock
symbolic-links=0
server-id=2
log-bin=mysql-bin
log-slave-updates
[root@lnmp2 data]# /etc/init.d/mysqld restart
  • 查看server2的data目录,可以看到2个日志,一个是二进制日志文件
    一个是复制主库A的二进制日志(中继日志文件)

C复制B的二进制文件

[root@lnmp2 data]# ls
auto.cnf         ibdata1      lnmp2-relay-bin.000003  mysql-bin.index     relay-log.info
ca-key.pem       ib_logfile0  lnmp2-relay-bin.000004  mysql.sock          server-cert.pem
ca.pem           ib_logfile1  lnmp2-relay-bin.index   mysql.sock.lock     server-key.pem
client-cert.pem  ibtmp1       master.info             performance_schema  sys
client-key.pem   lnmp2.err    mysql                   private_key.pem     westos
ib_buffer_pool   lnmp2.pid    mysql-bin.000001        public_key.pem

现在lnmp2既是master又是slave

mysql> show master status\G;
*************************** 1. row ***************************
             File: mysql-bin.000001
         Position: 154
     Binlog_Do_DB: 
 Binlog_Ignore_DB: 
Executed_Gtid_Set: 
1 row in set (0.00 sec)

ERROR: 
No query specified
mysql> show slave status\G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 172.25.21.1
                  Master_User: REPL
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 1908
               Relay_Log_File: lnmp2-relay-bin.000004
                Relay_Log_Pos: 320
        Relay_Master_Log_File: mysql-bin.000001
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 1908
              Relay_Log_Space: 527
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 1
                  Master_UUID: 167ce4c4-c2c8-11eb-85d9-525400f25677
             Master_Info_File: /usr/local/mysql/data/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 
                Auto_Position: 0
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Master_TLS_Version: 
1 row in set (0.00 sec)

ERROR: 
No query specified
  • 此时server3从server2上复制数据,需要授权用户
mysql> GRANT REPLICATION SLAVE ON *.* TO REPL@'%' IDENTIFIED BY 'westos';
  • 验证server2上的授权用户是否成功登陆
[root@lnmp3 ~]# mysql -h 172.25.21.2 -uREPL -pwestos
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.31-log Source distribution

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
  • server3设定master和user,并设定从库要记录的二进制日志
mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000001 |      437 |              |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
mysql> stop slave;
Query OK, 0 rows affected (0.14 sec)

mysql> CHANGE MASTER TO MASTER_HOST='172.25.21.2',MASTER_USER='REPL',MASTER_PASSWORD='westos',MASTER_LOG_FILE='mysql-bin.000001',MASTER_LOG_POS=437;
Query OK, 0 rows affected, 2 warnings (0.26 sec)
  • 如果server3的I/o线程显示No,则说明是用户能不能登陆,防火墙是否关闭
    SQL线程为No,说明不同步
mysql> start slave;
Query OK, 0 rows affected (0.10 sec)

mysql> show slave status\G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 172.25.21.2
                  Master_User: REPL
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 437
               Relay_Log_File: lnmp3-relay-bin.000002
                Relay_Log_Pos: 320
        Relay_Master_Log_File: mysql-bin.000001
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 437
              Relay_Log_Space: 527
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 2
                  Master_UUID: 86e432e0-e243-11eb-83d9-525400f6b245
             Master_Info_File: /usr/local/mysql/data/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 
                Auto_Position: 0
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Master_TLS_Version: 
1 row in set (0.00 sec)

ERROR: 
No query specified
  • 测试

master

mysql> INSERT  INTO  westos.user_tb VALUES('yao6',123);

server2(slave+master)

mysql> select * from westos.user_tb;
+----------+----------+
| username | password |
+----------+----------+
| yao1     | 123      |
| yao2     | 123      |
| yao3     | 123      |
| yao4     | 123      |
| yao5     | 123      |
| yao6     | 123      |
+----------+----------+

server3(slave)

mysql> select * from westos.user_tb;
+----------+----------+
| username | password |
+----------+----------+
| yao1     | 123      |
| yao2     | 123      |
| yao3     | 123      |
| yao4     | 123      |
| yao5     | 123      |
| yao6     | 123      |
+----------+----------+

同步成功!!!

A ——> B ——> C

B从A的binlog中接收到更新数据后,写入到中继日志文件relay
B的SQL线程将中继日志文件转换成实际操作之后,
会将这些操作记录到B的二进制文件中去,
以便于C的I/O线程去读取B的二进制文件

  • 使用mysqlbinlog命令去查看2个日志
[root@lnmp3 data]# mysqlbinlog lnmp3-relay-bin.000002 -v
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#210711 22:09:54 server id 3  end_log_pos 123 CRC32 0x12409927 	Start: binlog v 4, server v 5.7.31 created 210711 22:09:54
# This Format_description_event appears in a relay log and was generated by the slave thread.
# at 123
#210711 22:09:54 server id 3  end_log_pos 154 CRC32 0xb78c7f9e 	Previous-GTIDs
# [empty]
# at 154
#700101  8:00:00 server id 2  end_log_pos 0 CRC32 0xf316f5a6 	Rotate to mysql-bin.000001  pos: 437
# at 201
#210711 21:48:21 server id 2  end_log_pos 0 CRC32 0xe2433041 	Start: binlog v 4, server v 5.7.31-log created 210711 21:48:21
BINLOG '
pfbqYA8CAAAAdwAAAAAAAAAAAAQANS43LjMxLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
AUEwQ+I=
'/*!*/;
# at 320
#210711 22:10:37 server id 1  end_log_pos 502 CRC32 0x242c6352 	Anonymous_GTID	last_committed=1	sequence_number=2	rbr_only=yes
/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 385
#210711 22:10:37 server id 1  end_log_pos 565 CRC32 0xed676f2e 	Query	thread_id=15	exec_time=0	error_code=0
SET TIMESTAMP=1626012637/*!*/;
SET @@session.pseudo_thread_id=15/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=524288/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=33/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 448
#210711 22:10:37 server id 1  end_log_pos 622 CRC32 0x8beb09eb 	Table_map: `westos`.`user_tb` mapped to number 108
# at 505
#210711 22:10:37 server id 1  end_log_pos 667 CRC32 0x04fd79c7 	Write_rows: table id 108 flags: STMT_END_F

BINLOG '
3fvqYBMBAAAAOQAAAG4CAAAAAGwAAAAAAAEABndlc3RvcwAHdXNlcl90YgACDw8ESwCWAADrCeuL
3fvqYB4BAAAALQAAAJsCAAAAAGwAAAAAAAEAAgAC//wEeWFvNgMxMjPHef0E
'/*!*/;
### INSERT INTO `westos`.`user_tb`
### SET
###   @1='yao6'
###   @2='123'
# at 550
#210711 22:10:37 server id 1  end_log_pos 698 CRC32 0x036f9439 	Xid = 21
COMMIT/*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
[root@lnmp2 data]# mysqlbinlog lnmp2-relay-bin.000004 -v
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#210711 21:48:21 server id 2  end_log_pos 123 CRC32 0x82fec273 	Start: binlog v 4, server v 5.7.31-log created 210711 21:48:21
# This Format_description_event appears in a relay log and was generated by the slave thread.
# at 123
#210711 21:48:21 server id 2  end_log_pos 154 CRC32 0xb4a5eb78 	Previous-GTIDs
# [empty]
# at 154
#700101  8:00:00 server id 1  end_log_pos 0 CRC32 0xb974ed43 	Rotate to mysql-bin.000001  pos: 1908
# at 201
#210711 20:34:32 server id 1  end_log_pos 0 CRC32 0xcb0ae6b8 	Start: binlog v 4, server v 5.7.31-log created 210711 20:34:32
BINLOG '
WOXqYA8BAAAAdwAAAAAAAAAAAAQANS43LjMxLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
AbjmCss=
'/*!*/;
# at 320
#210711 22:10:37 server id 1  end_log_pos 1973 CRC32 0xae7b6511 	Anonymous_GTID	last_committed=7	sequence_number=8	rbr_only=yes
/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 385
#210711 22:10:37 server id 1  end_log_pos 2041 CRC32 0xf93239f0 	Query	thread_id=15	exec_time=0	error_code=0
SET TIMESTAMP=1626012637/*!*/;
SET @@session.pseudo_thread_id=15/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=1436549152/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=33/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 453
#210711 22:10:37 server id 1  end_log_pos 2098 CRC32 0x34498b96 	Table_map: `westos`.`user_tb` mapped to number 108
# at 510
#210711 22:10:37 server id 1  end_log_pos 2143 CRC32 0xaa31a47b 	Write_rows: table id 108 flags: STMT_END_F

BINLOG '
3fvqYBMBAAAAOQAAADIIAAAAAGwAAAAAAAEABndlc3RvcwAHdXNlcl90YgACDw8ESwCWAACWi0k0
3fvqYB4BAAAALQAAAF8IAAAAAGwAAAAAAAEAAgAC//wEeWFvNgMxMjN7pDGq
'/*!*/;
### INSERT INTO `westos`.`user_tb`
### SET
###   @1='yao6'
###   @2='123'
# at 555
#210711 22:10:37 server id 1  end_log_pos 2174 CRC32 0x684df261 	Xid = 154
COMMIT/*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值