mysql-sandbox for Debian
------------------------

mysql-sandbox is mostly used to quickly create mysql instances. It's primary
focus is on MySQL (and MariaDB, and Percona Server) release tarballs. Because
of that it expects certain structure and naming when using binaries that were
not part of upstream release tarball (i.e. binaries installed in the system by
the package manager). Luckily it includes a script to locate the binaries and
prepare the directory structure it expects. It looks for directories named
after the mysql version under /opt/mysql and ${HOME}/opt/mysql if the
SANDBOX_BINARIES environment variable is not specified. It doesn't
create those directories though.

In order to prepare the version directory in $HOME/opt/mysql from the currently
installed mysql binaries make sure that you have matching *-server, *-client
and *-libmysqlclient-dev packages installed on your system. Safest bet is having
default-mysql-server, default-mysql-client and default-libmysqlclient-dev on
your system. Having that you should run:

$ cd $HOME
$ mkdir -p opt/mysql
$ cd opt/mysql
$ make_sandbox_from_installed <version>

The above commands will create a directory ${HOME}/opt/mysql/<version> with
several directories inside ('bin','lib','share'). Inside those directories it
will create symlinks to files and directories installed in the system, so after
a system upgrade the version might not be right. make_sandbox_from_installed
will also try to create a mysql sandbox, but you don't have to do it to have
the version directory prepared for you.

To test if this has succeeded you can run:

$ test_sandbox --version=<version>

Now you can use all mysql-sandbox commands specifying using the version
you specified above, for example:

$ make_sandbox <version>

will create a single mysql sandox in ${HOME}/sandboxes/msb_<version>

On initial run it will also create a bunch of helper scripts in
${HOME}/sandboxes .

As said before, another way of using mysql-sandbox is with the release tarballs
downloaded manually from upstream. It expects the tarballs naming to be left
intact, because it parses the filename and extracts the mysql flavour and
version. The tarball is extracted to it's current directory, so you should save
the downloaded tarballs in ${HOME}/opt/mysql if this is where you want to
keep the mysql versioned dirs. For different mysql flavours you can add a
prefix to the version specified with --add_prefix= option to make_sandbox.

An example for installing mariadb downladed to ${HOME}/opt/mysql:

$ make_sandbox ${HOME}/opt/mysql/mariadb-10.1.10-linux-x86_64.tar.gz --add_prefix=mdb

This will create a mdb10.1.10 version in opt/mysql. You can use it as usual
afterwards:

$ make_multiple_sandbox mdb10.1.10

 -- Mateusz Kijowski <mateusz.kijowski@gmail.com>, Fri, 15 Jan 2016 22:04:38 +0100
