Yes, it's possible, but tricky.
Firstly, it's probably best not to use the RedHat supplied RPMS - they'll cause all sorts of dependency issues.
In essence, all you need to do is to build the two versions, and install them into completely different directories.
Then you need to make sure that they're configured with separate:
- data directories
- TCP ports
- Local connection sockets
- PID state files
In practise that can be done my creating two my.cnf
files, and making sure those are chosen in the command line parameters in the daemon start up scripts.
Note also that you'll need to be very careful with any shared libraries that might get built, particularly if you're running any client applications on the same server.
This gets nasty if, for example, you want Perl::DBD::mysql running, as it's not simple to arrange for there to be two copies, with each linked against a different version of the shared libraries.