I’m working with a setup where I have two separate MySQL servers, each hosting different databases. Let me explain what I’m trying to achieve.
My current environment:
First server hosts database called UserData
Second server contains database named ProductInfo
What I want to accomplish is setting up replication so both of these databases end up on a third MySQL server. The important thing is that I don’t want to run multiple MySQL instances on the destination server. Instead, I need a single MySQL instance that contains both UserData and ProductInfo databases through master-slave replication.
Is this kind of multi-source replication setup possible with MySQL? I’ve been researching different approaches but I’m not sure about the best way to configure this.
Yes, MySQL 5.7 and later supports multi-source replication. I implemented this setup for a client last year using three regional databases. Configure separate replication channels on your target server with the FOR CHANNEL clause to ensure each channel has its own relay logs and state, avoiding conflicts. However, be aware that it can become complicated quickly, as you’ll need to monitor multiple binlog positions and manage differing lag times from each master. Ensure your destination server has the capacity to handle the concurrent writes from these sources, and consider using GTID-based replication for smoother failovers.
Multi-source replication works fine with MySQL 5.7+. Set up separate replication channels for each source using CHANGE MASTER TO with the FOR CHANNEL parameter to tell your UserData and ProductInfo sources apart.
But honestly? MySQL multi-source replication gets messy fast. You’ll be juggling channel conflicts, tracking multiple binlog positions, and debugging replication lag from different sources.
I’ve been there. Automation platforms handle this way better than fighting with native MySQL replication. I build automated sync workflows that pull from both sources and merge everything into the target database.
You get better error handling, easier monitoring, and tons more flexibility for data transforms during the merge. Plus you can add validation rules and handle schema differences between sources.
Latenode makes these database sync workflows really easy to build and maintain. You can set up reliable pipelines that handle multi-source merging without the replication management headaches.
sure, mysql 5.7 or higher can do this. just configure the slave with two channels, one for each master. make sure to avoid name conflicts tho. i’ve done this before, and it works well when you get it all setup right.
Yes, multi-source replication is supported starting from MySQL 5.7. I implemented a similar setup last year during our regional server consolidation. To achieve this, you’ll need to configure each replication channel on your target server using the FOR CHANNEL clause. Set up separate channels for UserData and ProductInfo, allowing the slave to connect to both masters. Remember to assign unique server IDs across all three servers; this is critical to avoid conflicts. Be mindful of potential name clashes between tables, but since your databases are distinct, it shouldn’t be an issue. The performance impact was minimal in our case, though it’s wise to monitor disk I/O initially as you’ll be writing logs from two sources concurrently.