Installing multiple MySQL versions on the same Linux with mysql-sandbox
Ubuntu has a package
mysql-sandbox that lets you install multiple MySQL versions into your user home:
sudo apt install mysql-sandbox
Download the version of MySQL you want to use from mysql.com:
Make sure to choose "Generic Linux" instead of "Ubuntu" so you get a .tar.gz instead of .deb
cdinto the directory the mysql binaries will be extracted to
mkdir -p ~/bin/sandbox_dist cd ~/bin/sandbox_dist
- Build the sandbox
Note that make_sandbox will extract the files into the current folder and expects them to live there forever. That's why we switched to a persistent place like
On older distributions,
make_sandbox might be
This will install this version into
/~/sandboxes/msb_5_7.21. The folder includes a command to start the MySQL daemon for that sandbox. It listens to a non-standard port, so it can run in parallel with your regular MySQL installation.
Note the console output when you install a sandbox. It will show the non-standard port and the username (default
root) and password (default
msandbox). When working on a Rails project, you need to paste all of that into your
mysql --user=root --password=msandbox --host=127.0.0.1 --port=1234
1234 with the port for the Sandbox.
There is another card that describes how to achieve the same using docker.
Your development team has a full backlog of feature requests, chores and refactoring coupled with deadlines? We are familiar with that. With our "DevOps as a Service" offering, we support developer teams with infrastructure and operations expertise.