一、mysql 数据库binlog修改成row模式
修改mysql配置文件 vim /etc/my.cnf,在[mysqld]和[mysqld_safe]中间添加
log_bin=mysql
binlog-format=ROW
server_id=1
binlog-do-db=指定数据库名称,可以没有这行配置
二、service mysqld restart 重启mysql
三、检查mysql是否正确开启binlog并且是row模式
show master status;
show variables like '%log_bin%';
show variables;
四、XXX数据库信息:
数据库地址域名(从库):
从库IP:
端口:
数据库名:
需要创建新的用户名和密码,创建完并授权。
创建admin用户 create user admin identified by "123456";
赋超级权限 grant all privileges on *.* to admin@'%';
赋超级权限 grant all privileges on *.* to admin@'指定ip';
赋监听binlog权限grant select,replication slave,replication client on *.* to admin@'指定ip';