-1

I've set up two servers (one master and one slave db). I want to synchronize one single table of a whole database live (or with a delay of up to 5 minutes) in only one direction.

I wanted to try the DB replication in total first, but after setup I've seen that nothing happens. Unfortunately I don't know why nothing happens and I don't know how I should setup a single table replication. It is important that the slave will still work fine while the master is offline (php files are only reading those datasets then).

This is what my slave replica status is showing:

enter image description here

This is what my master status is showing:

enter image description here

This is the my.cnf of my master database:

server-id=5668439
log-bin=mysql-bin
log-error=mysql-bin.err
binlog_do_db=Forum

Why isn't it replicating and how would I need to change my config in order to reach my described goals?

Pierre.Vriens
  • 1,159
  • 34
  • 15
  • 19
kentor
  • 143
  • 1
  • 4
  • 10
  • Did you grant the appropriate privileges for the replication user? Based on the linked files it appears that the root user is being used for replication, which is probably not ideal from a security standpoint. The [MySQL Ref Manual](https://dev.mysql.com/doc/refman/5.1/en/replication-howto-repuser.html) has a good section about creating a replication user. – Matt Jul 16 '15 at 16:39
  • Yes I choosed the root user for testing purposes just to make sure I don't have a permission problem. – kentor Jul 16 '15 at 16:42
  • According to some of the comments it was necessary to grant the replication privileges with the full hostname of the slave not just a %. – Matt Jul 16 '15 at 16:44
  • That hasn't helped matt. :(. I was able to press the manual synchronization and it copied 20 tables but it doesn't go further :( – kentor Jul 16 '15 at 18:38
  • Did you do the initial database / table dump / restore when starting the replication? – Tero Kilkanen Jul 16 '15 at 21:56

1 Answers1

0

On master you need to have those lines:

server-id = 1

binlog_do_db = database

replicate-do-table = name

On slave:

server-id = 2

binlog_do_db = database

  • I was only able to start the mysql server with ´database replicate-do-table = database.name´ but still it is not doing anything. When I want to sync manually to starts syncing but stops after 20 tables or something – kentor Jul 16 '15 at 19:49
  • Did you try stoping the slave, and adding the master again ? change master host to='MASTER_IP', master_user="slave_replication_uer", master_password="slave_replication_user_password ", master_log_file="master_bin_log", master_log_pos=master_log_position(must be integer). – Alin Andrei Jul 20 '15 at 08:58