MySQL 复制:从站无法与主站通信(读取通信数据包时出错)
我有 2 个 Ubuntu 10.04 Server 虚拟机在 VirtualBox 上运行,并且具有仅主机网络静态 IP 地址配置。
机器 A:ubuntu-a 192.168.56.101
机器 B:ubuntu-b 192.168.56.102
机器可以通过主机名或 IP 地址相互 ping 通。
两个系统上均安装了 MySQL 5.1。我想实现以 ubuntu-a 作为主、ubuntu-b 作为从的复制。
我在 ubuntu-a 上有一个名为 project1 的数据库,我想要复制它。
我已经使用以下命令在主服务器上设置了一个用户:
mysql> grant replication client, replication slave on *.* to repl@'%' identified by '!!abc123';
my.cnf on ubuntu-a (master):
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = project1
my.cnf on ubuntu-b (slave):
server-id = 2
master-host = 192.168.56.101
master-user = repl
master-password = !!abc123
master-connect-retry = 60
replicate-do-db = project1
但是,当我尝试将数据导入到从服务器时,我得到了这个错误:
mysql> load data from master;
ERROR 1158 (08S01): Got an error reading communication packets
知道为什么会发生这种情况吗?
I've got 2 Ubuntu 10.04 Server virtual machines running on VirtualBox with host-only network static IP address configuration.
Machine A: ubuntu-a 192.168.56.101
Machine B: ubuntu-b 192.168.56.102
Machines can ping each other via either hostnames or IP address.
MySQL 5.1 installed on both systems. I want to achieve replication with ubuntu-a as the master and ubuntu-b as the slave.
I have a database name project1 on ubuntu-a that I want to replicate.
I've set up a user on the master with this command:
mysql> grant replication client, replication slave on *.* to repl@'%' identified by '!!abc123';
my.cnf on ubuntu-a (master):
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = project1
my.cnf on ubuntu-b (slave):
server-id = 2
master-host = 192.168.56.101
master-user = repl
master-password = !!abc123
master-connect-retry = 60
replicate-do-db = project1
However, when I try to import the data to the slave I get this error:
mysql> load data from master;
ERROR 1158 (08S01): Got an error reading communication packets
Any idea why this could be happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论