具体操作步骤 说明:主从数据库版本一致 1.主库创建同步使用的用户 create user 'repl'@'%' identified with 'mysql_native_password' by 'repl_User_123'; GRANT ALL privileges ON *.* TO 'repl'@'%' with grant option; flush privileges; # 必要时主库需要开启远程连接,供其他ip的主机连接 该用户权限仅设置replication slave,r