I currently have mysql 5.5 installed, and working.
I'd like to migrate everything to mysql 5.7 (for a number of reasons, but mostly the spatial functions).
I would like to have both 5.5 and 5.7 be running at the same time on the same box.
How can I do that?
There are problems here in attempting to do what you are asking and keeping your package manager happy.
Off the top, I see two choices here:
compile/install from scratch to an entirely different directory hierarchy
If I recall, there is a way to install packages using a different base root directory. Do that and then manually make the necessary changes.
Either way, there could be some effort involved.
It is possible to have both MySQL servers running on the same machine but, it'll take some work.
First you would need to install 5.7 in a different directory than 5.5. Also since MySQL uses a default port, you would need to run 5.7 on a different port.
You're basically creating an entire new MySQL server
update-alternatives is a program that could work for you as well. (I have not tested this)
--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