mysql 主从同步

server-id=1
log-bin=/var/lib/mysql/mysql-bin.log
重启
show master statusG;

打开mysql
flush tables with read lock;

exit;
mysqldump -hlocalhost -uroot -p3306 -p test >/home/test.sql

cd /home

scp test.sql root@192.168.52.129:/home/


mysql
unlock tables;

grant replication slave on "." to 'slaveuser'@'192.168.52.129' identified by '123456'

从服务器
master-host=192.168.52.128
master-user=slaveuser
master-pass=123456
master-port=3306
master-connect-retry=60
replicate-do-db=test

show slave statusG

MySQL Error
Message: 没有连接到MySQL数据库
SQL:
Error: Lost connection to MySQL server at 'reading initial communication packet', system error: 110
Errno.: 2013

数据库在一台win2003上, 我用另一台linux连接报上面的错误, 可使用另一台win2003就可以连接成功。
my.ini 配置如下
[mysqld]
skip-name-resolve
skip-locking

max_allowed_packet=256M