Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have a Oracle Linux 5 server. I have to install MySQL 5.1 as well as MySQL 5.6. Is it possible to install both version of MySQL on the same machine? If yes, how can I achieve this?

share|improve this question

1 Answer 1

The program that can accomplish this is called update-alternatives

You should be able to do something like this (untested)

update-alternatives --install /usr/bin/mysql-server mysql-server /usr/bin/mysql-5-1/bin/mysql-server 10
update-alternatives --install /usr/bin/mysql-server mysql-server /usr/bin/mysql-5-6/bin/mysql-server 10 
  • --install adds a new mapping
  • /usr/bin/mysql-server is the link location (where mysql-server normally is located)
  • mysql-server is the name of the mapping
  • /usr/bin/mysql-5-6/bin/mysql-servera is where I placed the new version of mysql-server
  • 10 is the priority

You then choose which version of mysql-server you want like so

update-alternatives --set mysql-server /usr/bin/mysql-5-6/bin/mysql-server

The way this works is by creating a symbolic link from /usr/bin/mysql-server and pointing it to the new path. ( /usr/bin/mysql-5-1/bin/mysql-server)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.