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.