[root@lvcx02 ~]# mysql -S /tmp/lvtu3306.sock -u root -p
mysql> use blues;
Database changed
mysql> show tables;
+-----------------+
| Tables_in_blues |
+-----------------+
| customer |
| district |
| history |
| item |
| new_orders |
| order_line |
| orders |
| stock |
| warehouse |
+-----------------+
9 rows in set (0.00 sec)
mysql> select count(*) from order_line;
+----------+
| count(*) |
+----------+
| 299575 |
+----------+
1 row in set (0.76 sec)
mysql> show variables like '%autocommit%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| autocommit | ON |
+---------------+-------+
1 row in set (0.02 sec)
mysql> select count(*) from order_line;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.29 sec)
mysql> show global variables like '%server_id%';
+----------------+--------+
| Variable_name | Value |
+----------------+--------+
| server_id | 330602 |
| server_id_bits | 32 |
+----------------+--------+
2 rows in set (0.00 sec)
[root@lvcx04 ~]# mysql -S /tmp/lvtu3306.sock -u root -p
Enter password:
mysql> use tpcc;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+----------------+
| Tables_in_tpcc |
+----------------+
| customer |
| district |
| history |
| item |
| new_orders |
| order_line |
| orders |
| stock |
| warehouse |
+----------------+
9 rows in set (0.00 sec)
mysql> select count(*) from order_line ;
+----------+
| count(*) |
+----------+
| 4650236 |
+----------+
1 row in set (3 min 17.77 sec)
mysql> select count(*) from warehouse ;
+----------+
| count(*) |
+----------+
| 100 |
+----------+
1 row in set (0.97 sec)
mysql> show global variables like 'server_id';
+---------------+--------+
| Variable_name | Value |
+---------------+--------+
| server_id | 330604 |
+---------------+--------+
1 row in set (0.00 sec)
mysql> show global variables like 'autocommit';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| autocommit | ON |
+---------------+-------+
1 row in set (0.00 sec)
默认情况:pt-table-checksum 会检查binlog format,进行checksum较验,将检查保存在percona.checksums表中[如果该表不存在,会直接创建],各表在进行checksum前,会将该先前checksum结果清空,并检查主从间各表数据的一致性,同时会检查query plan 以及复制过滤规则