linux rpm方式安装mysql5.1
一、首先两台服务器安装好mysql数据库环境 参照 linux rpm方式安装mysql5.1 https://www.cnblogs.com/sky-cheng/p/10564604.html 二、主库master上创建主从复制账号 mysql> grant replication slave,replication client on *.* to 'repl'@'%' identified by 'Zaq1xsw@'; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> use mysql; 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> select user,host from user; +---------------+-----------+ | user | host | +---------------+-----------+ | repl | % | | root | % | | mysql.session | localhost | |