tags:

views:

46

answers:

2

We have a Linux server running Red Hat Enterprise 3 and MySQL 3.23. This server has a number of websites on it.

We have a new website that we want to put on this server that uses MySQL 4/5. Is it possible to run the two versions of MySQL in parallel?

If so, how?

A: 

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.

Alnitak
+1  A: 

Yes you can. Of course on of the servers would have to use non-standard port number.

See the documentation http://dev.mysql.com/doc/refman/5.1/en/multiple-unix-servers.html

vartec
Or bind it to another IP address.
staticsan