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

Posted May 8, 2014 1.3k 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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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.