Posted almost 5 years ago. Visible to the public. Repeats. External content.

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:

Copy
sudo apt install mysql-sandbox # Download mysql distribution .tar.gz from mysql.com # You must choose "Generic Linux" instead of "Ubuntu" so you get a .tar.gz instead of .deb make_sandbox mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz

Note that will extract the files into the current folder and expects them to live there forever. You might want to move the file to a persistent place like bin/sandbox_dist before.

On older distributions, make_sandbox might be mysql_sandbox instead.

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 config/database.yml.

Connecting to a sandbox

Copy
mysql --user=root --password=msandbox --host=127.0.0.1 --port=1234

Replace 1234 with the port for the Sandbox.

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Henning Koch
Last edit:
3 months ago
by Henning Koch
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Henning Koch to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more