How to configure MySQL master and slave both run on only one physical host and achieve replication between the two

May 8, 2014 631 views
We want to setup MySQL Master as well as Slave to run on same physical host and achieve replication. How to do it? Steps with example would be great.. Thanks Rajiv
1 Answer
Hi Rajiv,

I'm curious. Whats the use case for this? I'm not sure I've ever see it done. While its technically possible, you loose a lot of the benefits of redundancy by having it on the same host machine. See this discussion over on DBA StackExchange:

How To Forge has a tutorial doing this by compiling two completely different mysql binaries:

I could also imagine doing it using lxc containers or docker.
Have another answer? Share your knowledge.