mariadb的主从复制一次报错小记

slave体现不了master的数据更新

刚刚解决,趁机水一篇博客

报错体现

Slave_IO_Running:Connecting

查看一些报错信息

error connecting to master 'slave@192.168.116.22:3306' - retry-time: 60  retries: 86400  message: Host '192.168.116.33' is not allowed to connect to this MariaDB server

问题出在访问连接权限上面。
解决方法:

grant replication slave on *.* to 'slave'@'192.168.116.%';
grant replication user_name on *.* to  'user_name'@'ip'

user_name用户名,ip可以使用%通配符