天天看点

mysql replicate_do_db_mysql主从复制 REPLICATE_DO_DB 参数从服务器reboot后每次都回滚为初始设置...

我在微软云上搭建mysql主从复制master-slave

使用了bitnami with replication 的镜像

镜像中my.cnf配置(主服务器)

[mysqladmin]

user=

[mysqld]

skip-name-resolve

basedir=/opt/bitnami/mysql

port=3306

socket=/opt/bitnami/mysql/tmp/mysql.sock

tmpdir=/opt/bitnami/mysql/tmp

max_allowed_packet=16M

bind-address=0.0.0.0

pid-file=/opt/bitnami/mysql/tmp/mysqld.pid

log-error=/opt/bitnami/mysql/logs/mysqld.log

character-set-server=UTF8

collation-server=utf8_general_ci

[client]

port=3306

socket=/opt/bitnami/mysql/tmp/mysql.sock

default-character-set=UTF8

[manager]

port=3306

socket=/opt/bitnami/mysql/tmp/mysql.sock

pid-file=/opt/bitnami/mysql/tmp/mysqld.pid

!include /bitnami/mysql/conf/my_custom.cnf

镜像中my.cnf配置(从服务器)

[mysqladmin]

user=

[mysqld]

skip-name-resolve

basedir=/opt/bitnami/mysql

port=3306

socket=/opt/bitnami/mysql/tmp/mysql.sock

tmpdir=/opt/bitnami/mysql/tmp

max_allowed_packet=16M

bind-address=0.0.0.0

pid-file=/opt/bitnami/mysql/tmp/mysqld.pid

log-error=/opt/bitnami/mysql/logs/mysqld.log

character-set-server=UTF8

collation-server=utf8_general_ci

[client]

port=3306

socket=/opt/bitnami/mysql/tmp/mysql.sock

default-character-set=UTF8

[manager]

port=3306

socket=/opt/bitnami/mysql/tmp/mysql.sock

pid-file=/opt/bitnami/mysql/tmp/mysqld.pid

!include /bitnami/mysql/conf/my_custom.cnf

并没有关于REPLICATE_DO_DB 参数的设置

连接进入mysql后执行sql修改REPLICATE_DO_DB

CHANGE REPLICATION FILTER REPLICATE_DO_DB = ();

在启动slave;主从复制是可以得的,可是每次reboot从服务器后REPLICATE_DO_DB都会回滚回默认bitnami数据库

是不是还有其他地方设置REPLICATE_DO_DB?