In laboratory environments is very useful run two or more instances of MySQL for test new versions, configurations or test a master-slave replication using the same system, we can get this through MySQL Sandbox. MySQL Sandbox is a script written in perl that install multiple MySQL isolated instances with own settings for each instance and listening on different ports. For do this we need to install the script and download tarball of MySQL version that we need to install. I’ll show the basic deployment of one instance and the configuration of two basic instances for two different system users.

Installing MySQL sandbox

1.- Download and unpack the mysql sandbox script:

# mkdir /mysql-sandbox
# cd /mysql-sandbox ; wget
# tar -xzvf MySQL-Sandbox-3.0.25.tar.gz

2.- Installation:

# cd MySQL-Sandbox-3.0.25/
# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for MySQL::Sandbox
# make
# make test && make install

Manage commands for MySQL sandbox:

3.- Download the latest version of MySQL:

# wget -O /mysql-sandbox/mysql-5.5.27-linux2.6-i686.tar.gz

4.- Install MySQL dependency:

# apt-get install libaio1

Create our sandbox instance

$ /usr/local/bin/make_sandbox /mysql-sandbox/mysql-5.5.27-linux2.6-i686.tar.gz
unpacking /mysql-sandbox/mysql-5.5.27-linux2.6-i686.tar.gz
Executing low_level_make_sandbox --basedir=/mysql-sandbox/5.5.27 

Starting our instance

$ /mysql-sandbox/5.5.27/scripts/mysql_install_db --user=usu1 --ldata=/home/usu1/sandboxes/msb_5_5_27/data --basedir=/mysql-sandbox/5.5.27
$ /home/usu1/sandboxes/msb_5_5_27/start

Configuration for two instances of MySQL SandBox



Official project web page:

configuring MySQL Sandbox
Tagged on:     

Leave a Reply


Get every new post delivered to your Inbox

Join other followers: