ERROR:
No query specified
在 Slave服务器查看启动的线程
[root@slave ~]# mysql -e
"show processlist;"
+----+-------------+-----------+------+---------+------+------------------------------------------------------------------------
| Id | User | Host | db
|
Command |
Time |
State | Info |
+----+-------------+-----------+------+---------+------+------------------------------------------------------------------------
| 3 | system user | | NULL | Connect | 533 | Waiting for master to send event | NULL
|
| 4 | system user | | NULL | Connect |
533
| Slave has read all relay log; waiting for the slave I/O thread to update i t |
NULL |
| 5 |
root |
localhost |
NULL | Query
| 0 |
init | show processlist |
在 Master服务器创建数据库并在 Slave服务器上验证是否存在
###在 Master 服务器创建数据库并查看
[root@master ~]# mysql -e 'create database mydbtest;' [root@master ~]# mysql -e 'show databases;'
| Database |
+--------------------+
| information_schema |
| mydbtest |
| mysql |
| performance_schema |
| test |
###在 Slave 服务器查看是否有'mydbtest'数据库
[root@slave ~]# mysql -e 'show databases;'
| Database |
+--------------------+
| information_schema |
| mydbtest | #数据库已经成功同步到 slave 服务器
| mysql |
| performance_schema |
| test |
在 Master与 Slave服务器查看二进制日志事件位置已更新
###查看 Master 服务器
[root@master ~]# mysql -e 'show master status;'
+-------------------+----------+--------------+------------------+-------------------+
| File |
Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |