Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Adding a db for replication into mysql

$
0
0

Currently I have these settings. I am adding a new db called mydb3. How to enable the replication for this new db? Currently I have copied the table schema into both master and slave. What other changes must I do ? Can I just add binlog_do_db=mydb3 and replicate-do-db=mydb3 on both master and slave?

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

innodb_file_per_table
innodb_lock_wait_timeout=120
innodb_buffer_pool=5G
innodb_log_file_size=512M


server-id=1
log-bin=mysql-bin
log-error=mysql-bin.err
binlog_do_db=mydb1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

For the slave here is the settings.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0


innodb_file_per_table
server-id=1339951115
master-host = ***
master-user = ***
master-password =***
master-port = 3306
replicate-do-db=mydb1
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>