5
This package is a sandbox for testing features under any version of
6
MySQL from 3.23 to 6.0.
8
It will install one node under your home directory, and it will provide
9
some useful commands to start, use and stop this sandbox.
11
With this package you can play with new MySQL releases without need of
12
using other computers. The server installed in the sandbox use
13
non-standard data directory, ports and sockets, so they won't interfere
14
with existing MYSQL installations.
20
The easiest way to make a sandbox is
22
1. download the sandbox package and expand it somewhere
23
2. download a MySQL binary tarball
26
$ ./make_sandbox /path/to/mysql-X.X.XX-osinfo.tar.gz
28
That's all it takes to get started. The Sandbox will ask you for
29
confirmation, and then it will tell you where it has installed your
32
By default, the sandbox creates a new instance for you under
33
$HOME/sandboxes/msb_X_X_XX
35
MAKING A REPLICATION SANDBOX
37
It's as easy as making a single sandbox $ ./make_replication_sandbox
38
/path/to/mysql-X.X.XX-osinfo.tar.gz
40
This will create a new instance of one master and two slaves under
41
$HOME/sandboxes/rsandbox_X_X_XX
45
It requires an appropriate option when you start a replication sandbox
47
$ ./make_replication_sandbox --topology=circular /path/to/mysql-X.X.XX-osinfo.tar.gz
49
This will create a replication system with three servers connected by
50
circular replication. A handy shortcut is --master_master, which will
51
create a circular replication system of exactly two members.
54
You can create a group of sandboxes without any replication among its
55
members. If you need three servers of the same version, you can use
57
$ ./make_multiple_sandbox /path/to/tarball
59
If you need servers of different versions in the same group, you may
62
$ ./make_multiple_custom_sandbox /path/to/tarball1 path/to/tarball2 /path/to/tb3
64
Assuming that each tarball is from a different version, you will group
65
three servers under one directory, with the handy sandbox scripts to
68
DEFAULTS AND SHORTCUTS
69
If you use sandboxes often, instead of pointing to a tarball you can set
70
a directory containing expanded tarballs. By default, the sandbox looks
71
under $HOME/opt/mysql and /opt/mysql
73
The expanded tarballs must be named with the full version. e.g.
74
$HOME/opt/mysql/5.0.64 /opt/mysql/5.1.24
76
If you have such an organization, then you can invoke every sandbox
77
script with this abridged syntax:
80
./make_replication_sandbox 5.1.25
81
./make_multiple_custom_sandbox 5.0.64 5.1.25
83
If you use some options frequently, it would make sense to add them to
84
the default option file, which is $HOME/.msandboxrc
87
Every sandbox script will give you additional information if you invoke
88
it with the "--help" option.
90
When creating a single sandbox, you can pass to the new server most any
91
option that can be used in a my.cnf file, in addition to specific
94
Multiple and replication sandboxes, for example, accept a
95
--how_many_slaves=X or --how_many_nodes=X option, allowing you to create
99
Unless you override the defaults, sandboxes are created inside a
100
directory that servers two purposes:
102
* further isolates the sandboxes, and keep them under easy control if
103
you are in the habit of creating many of them;
104
* provides a set of handy super-commands, which can be passed to all the
105
sandboxes. Running "$HOME/sandboxes/stop_all" you will stop all servers
106
of all sandboxes, single or groups, below that directory.
109
Change directory to the newly created one (default:
110
$HOME/sandboxes/msb_VERSION for single sandboxes)
112
The sandbox directory of the instance you just created contains some
113
handy scripts to manage your server easily and in isolation.
117
stop "./start", "./restart", and "./stop" do what their name suggests.
118
use "./use" calls the command line client with the appropriate
120
clear "./clear" stops the server and removes everything from the data
121
directory, letting you ready to start from scratch.
122
multiple server sandbox On a replication sandbox, you have the same
123
commands, with a "_all" suffix, meaning that you propagate the command
124
to all the members. Then you have "./m" as a shortcut to use the master,
125
"./s1" and "./s2" to access the slaves (and "s3", "s4" ... if you define
136
There are 2 database users installed by default:
138
+-----------------+-------------+-------------------------------+
139
| user name | password | privileges |
140
+-----------------+-------------+-------------------------------+
141
| root@localhost | msandbox | all on *.* with grant option |
142
| msandbox@% | msandbox | all on *.* |
143
+-----------------+-------------+-------------------------------+
146
Ports are created from the server version. a 5.1.25 server will use port
147
5125, unless you override the default. Replicated and group sandboxes
148
add a delta number to the version figure, to avoid clashing with single
151
(note: ports can be overriden using -P option during install)
153
+--------+-----------------------------+
155
+--------+-----------------------------+
156
| 3310 | /tmp/mysql_sandbox3310.sock |
157
+--------+-----------------------------+
159
ENVIRONMENT VARIABLES
160
All programs in the Sandbox suite recognize and uses the following
163
* HOME the user's home directory
164
* USER the operating system user
165
* PATH the execution path
166
* DEBUG if set, the programs will print debugging messages
168
In addition to the above, make_sandbox will use * BINARY_BASE the
169
directory containing the installation server binaries
171
make_replication_sandbox will recognize the following * MASTER_OPTIONS
172
additional options to be passed to the master * SLAVE_OPTIONS additional
173
options to be passed to each slave
176
To use this package you need at least the following:
178
* Linux or Mac OSX operating system (it may work in other *NIX OSs, but
180
* a binary tarball of MySQL 3.23 or later
181
* Perl 5.8.1 or later (for installation only)
186
Copyright © 2006,2007,2008 Giuseppe Maxia Home Page
187
http://launchpad.net/mysql-sandbox/
190
This program is free software; you can redistribute it and/or modify it
191
under the terms of the GNU General Public License as published by the
192
Free Software Foundation; version 2 of the License.
194
This program is distributed in the hope that it will be useful, but
195
WITHOUT ANY WARRANTY; without even the implied warranty of
196
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
197
Public License for more details.
199
You should have received a copy of the GNU General Public License along
200
with this program; if not, write to the Free Software Foundation, Inc.,
201
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA