Rather than using a production setup, where each instance runs
on a separate host, AdminAPI provides the
dba.deploySandboxInstance(
operation. The port_number)port_number argument
is the TCP port number where the MySQL Server instance listens
for connections. To deploy a new sandbox instance which is bound
to port 3310, issue:
mysql-js> dba.deploySandboxInstance(3310)
By default the sandbox is created in a directory named
$HOME/mysql-sandboxes/
on Unix systems. For Microsoft Windows systems the directory is
port%userprofile%\MySQL\mysql-sandboxes\.
Each sandbox instance is stored in a directory named after the
portport_number.
You are prompted for the root user's password.
Each sandbox instance uses the root user and password, and it must be the same on all sandbox instances which should work together. This is not recommended in production.
To deploy another sandbox server instance, repeat the steps followed for the sandbox instance at port 3310, choosing different port numbers for each instance.
To change the directory which sandboxes are stored in, for
example to run multiple sandboxes on one host for testing
purposes, use the MySQL Shell sandboxDir
option. For example, to use a sandbox in the
/home/user/sandbox1 directory, issue:
mysql-js> shell.options.sandboxDir='/home/user/sandbox1'
All subsequent sandbox related operations are then executed
against the instances found at
/home/user/sandbox1.
When you deploy sandboxes, MySQL Shell searches for the
mysqld binary, which it then uses to create
the sandbox instance. You can configure where MySQL Shell
searches for the mysqld binary by configuring
the mysqldPath option. This can be useful to
test a new version of MySQL locally before deploying it to
production.
The following options are supported by the
dba.deploySandboxInstance() operation:
allowRootFromconfigures which host the root user can connect from. Defaults toroot@%.ignoreSslErrorconfigures secure connections on the sandbox instance. WhenignoreSslErroris true, which is the default, no error is issued during the operation if SSL support cannot be provided and the server instance is deployed without SSL support. WhenignoreSslErroris set tofalse, the sandbox instance is deployed with SSL support, issuing an error if SSL support cannot be configured.mysqldOptionsconfigures additional options on the sandbox instance. Defaults to an empty string, and accepts a list of strings that specify options and values. For examplemysqldOptions: ["lower_case_table_names=1", "report_host="10.1.2.3"]}. The specified options are written to the sandbox instance's option file.portXconfigures the port used for X Protocol connections. The default is calculated by multiplying theportvalue by 10. The value is an integer between 1024 and 65535.mysqldPathenables you to specify the path to themysqldbinary, or MySQL installation root, to use as the seed instance for your sandbox deployment.