I built mysql master-slave replication on Microsoft Cloud
I used bitnami with replication mirror
my.cnf configuration in the mirror (main server)
[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 configuration in the mirror (slave server)
[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
There is no setting for the REPLICATE_DO_DB parameter
After connecting to mysql, execute sql to modify REPLICATE_DO_DB
CHANGE REPLICATION FILTER REPLICATE_DO_DB = ();
After starting the slave; master-slave replication is available, but REPLICATE_DO_DB will be rolled back to the default after each reboot of the slave server bitnami database
Is there any other place to set REPLICATE_DO_DB?
这种情况肯定是在默认启动参数中配置了才会按这个启动(猜测要么你看的配置文件不对,要么可能在你创建的时候就配置的),你需要将你的自定义参数写到配置文件中尝试一下
把主从配置信息写入配置文件!
自己linux不熟出现的问题,是在配置文件里面
配置文件最后 !include /bitnami/mysql/conf/my_custom.cnf
linux文件链接
这里配置。。。文件找了很久