MySQL Sandbox

Contents

[edit] The MySQL Sandbox

[edit] PURPOSE

This package is a sandbox for testing features under any version of MySQL from 3.23 to 6.0.

It will install one node under your home directory, and it will provide some useful commands to start, use and stop this sandbox.

With this package you can play with new MySQL releases without need of using other computers. The server installed in the sandbox use non-standard data directory, ports and sockets, so they won't interfere with existing MYSQL installations.

[edit] MAKING SANDBOXES

[edit] SINGLE SERVER SANDBOX

The easiest way to make a sandbox is

  1. download the sandbox package and expand it somewhere;
  2. download a MySQL binary tarball;
  3. run this command
$ ./make_sandbox /path/to/mysql-X.X.XX-osinfo.tar.gz

That's all it takes to get started. The Sandbox will ask you for confirmation, and then it will tell you where it has installed your server.

By default, the sandbox creates a new instance for you under $HOME/sandboxes/msb_X_X_XX

[edit] MAKING A REPLICATION SANDBOX

It's as easy as making a single sandbox $ ./make_replication_sandbox /path/to/mysql-X.X.XX-osinfo.tar.gz

This will create a new instance of one master and two slaves under $HOME/sandboxes/rsandbox_X_X_XX

[edit] CIRCULAR REPLICATION

It requires an appropriate option when you start a replication sandbox

  $ ./make_replication_sandbox --topology=circular /path/to/mysql-X.X.XX-osinfo.tar.gz

This will create a replication system with three servers connected by circular replication. A handy shortcut is C(--master_master), which will create a circular replication system of exactly two members.

[edit] MULTIPLE SANDBOXES

You can create a group of sandboxes without any replication among its members. If you need three servers of the same version, you can use

$ ./make_multiple_sandbox /path/to/tarball 
   

If you need servers of different versions in the same group, you may like

$ ./make_multiple_custom_sandbox /path/to/tarball1 path/to/tarball2 /path/to/tb3 

Assuming that each tarball is from a different version, you will group three servers under one directory, with the handy sandbox scripts to manipulate them.

[edit] DEFAULTS AND SHORTCUTS

If you use sandboxes often, instead of pointing to a tarball you can set a directory containing expanded tarballs. By default, the sandbox looks under $HOME/opt/mysql and /opt/mysql

The expanded tarballs must be named with the full version. e.g. $HOME/opt/mysql/5.0.64 /opt/mysql/5.1.24

If you have such an organization, then you can invoke every sandbox script with this abridged syntax:

 ./make_sandbox 5.0.64
 ./make_replication_sandbox 5.1.25
 ./make_multiple_custom_sandbox 5.0.64 5.1.25

If you use some options frequently, it would make sense to add them to the default option file, which is $HOME/.msandboxrc

[edit] FINE TUNING

Every sandbox script will give you additional information if you invoke it with the "--help" option.

When creating a single sandbox, you can pass to the new server most any option that can be used in a my.cnf file, in addition to specific sandbox options.

Multiple and replication sandboxes, for example, accept a --how_many_slaves=X or --how_many_nodes=X option, allowing you to create very large groups.

[edit] SANDBOX HOME

Unless you override the defaults, sandboxes are created inside a directory that servers two purposes:

[edit] USING A SANDBOX

Change directory to the newly created one (default: $HOME/sandboxes/msb_VERSION for single sandboxes)

The sandbox directory of the instance you just created contains some handy scripts to manage your server easily and in isolation.

[edit] DATABASE USERS

There are 2 database users installed by default:

+-----------------+-------------+-------------------------------+
|  user name      | password    | privileges                    |
+-----------------+-------------+-------------------------------+
|  root@localhost | msandbox    | all on *.* with grant option  |
|  msandbox@%     | msandbox    | all on *.*                    |
+-----------------+-------------+-------------------------------+

[edit] PORTS AND SOCKETS

Ports are created from the server version. a 5.1.25 server will use port 5125, unless you override the default. Replicated and group sandboxes add a delta number to the version figure, to avoid clashing with single installations.

(note: ports can be overridden using -P option during install)

+--------+-----------------------------+
| port   | socket                      |
+--------+-----------------------------+
|  3310  | /tmp/mysql_sandbox3310.sock |
+--------+-----------------------------+

[edit] ENVIRONMENT VARIABLES

All programs in the Sandbox suite recognize and uses the following variables:

In addition to the above, make_sandbox will use

make_replication_sandbox will recognize the following

[edit] REQUIREMENTS

To use this package you need at least the following:

[edit] COPYRIGHT version 2.0

Copyright © 2006,2007,2008 Giuseppe Maxia

Home Page http://launchpad.net/mysql-sandbox/

[edit] LEGAL NOTICE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Retrieved from "http://forge.mysql.com/wiki/MySQL_Sandbox"

This page has been accessed 417 times. This page was last modified 22:20, 3 July 2008.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...