(mysql.info) instance-manager-commands
Info Catalog
(mysql.info) instance-manager-configuration-files
(mysql.info) instance-manager
5.5.5 Commands Recognized by the MySQL Instance Manager
-------------------------------------------------------
Once you've set up a password file for the MySQL Instance Manager and
the IM is running, you can connect to it. You can use the `mysql'
client tool connect through a standard MySQL API. The following list of
commands shows the MySQL Instance Manager currently accepts, with
samples.
* `START INSTANCE INSTANCE_NAME'
This command attempts to start an instance.
mysql> START INSTANCE mysqld4;
Query OK, 0 rows affected (0,00 sec)
* `STOP INSTANCE INSTANCE_NAME'
This command attempts to stop an instance.
mysql> STOP INSTANCE mysqld4;
Query OK, 0 rows affected (0,00 sec)
* `SHOW INSTANCES'
Shows the names of all loaded instances.
mysql> SHOW INSTANCES;
+---------------+---------+
| instance_name | status |
+---------------+---------+
| mysqld3 | offline |
| mysqld4 | online |
| mysqld2 | offline |
+---------------+---------+
3 rows in set (0,04 sec)
* `SHOW INSTANCE STATUS INSTANCE_NAME'
Shows the status and the version information for an instance.
mysql> SHOW INSTANCE STATUS mysqld3;
+---------------+--------+---------+
| instance_name | status | version |
+---------------+--------+---------+
| mysqld3 | online | unknown |
+---------------+--------+---------+
1 row in set (0.00 sec)
* `SHOW INSTANCE OPTIONS INSTANCE_NAME'
Shows the options used by an instance.
mysql> SHOW INSTANCE OPTIONS mysqld3;
+---------------+---------------------------------------------------+
| option_name | value |
+---------------+---------------------------------------------------+
| instance_name | mysqld3 |
| mysqld-path | /home/cps/mysql/trees/mysql-4.1/sql/mysqld |
| port | 3309 |
| socket | /tmp/mysql.sock3 |
| pid-file | hostname.pid3 |
| datadir | /home/cps/mysql_data/data_dir1/ |
| language | /home/cps/mysql/trees/mysql-4.1/sql/share/english |
+---------------+---------------------------------------------------+
7 rows in set (0.01 sec)
* `SHOW INSTANCE_NAME LOG FILES'
The command lists all log files used by the instance. The result
set contains the path to the log file and the log file size. If no
log file path is specified in the configuration file (for example,
`log=/var/mysql.log'), the Instance Manager tries to guess its
placement. If the IM is unable to guess the logfile placement you
should specify the log file location explicitly by using the
appropriate log option in the instance section of the
configuration file.
mysql> SHOW mysqld LOG FILES;
+-------------+------------------------------------+----------+
| Logfile | Path | Filesize |
+-------------+------------------------------------+----------+
| ERROR LOG | /home/cps/var/mysql/owlet.err | 9186 |
| GENERAL LOG | /home/cps/var/mysql/owlet.log | 471503 |
| SLOW LOG | /home/cps/var/mysql/owlet-slow.log | 4463 |
+-------------+------------------------------------+----------+
3 rows in set (0.01 sec)
* `SHOW INSTANCE_NAME LOG {ERROR | SLOW | GENERAL}
SIZE[,OFFSET_FROM_END]'
This command retrieves a portion of the specified log file.
Because most users are interested in the latest log messages, the
SIZE parameter defines the number of bytes you would like to
retrieve starting from the log end. You can retrieve data from the
middle of the log file by specifying the optional OFFSET_FROM_END
parameter. The following example retrieves 21 bytes of data,
starting 23 bytes from the end of the log file and ending 2 bytes
from the end of the log file:
mysql> SHOW mysqld LOG GENERAL 21, 2;
+---------------------+
| Log |
+---------------------+
| using password: YES |
+---------------------+
1 row in set (0.00 sec)
* `SET INSTANCE_NAME.OPTION_NAME=OPTION_VALUE'
This command edits the specified instance's configuration file to
change or add instance options. The IM assumes that the
configuration file is located at `/etc/my.cnf'. You should check
that the file exists and has appropriate permissions.
mysql> SET mysqld2.port=3322;
Query OK, 0 rows affected (0.00 sec)
Changes made to the configuration file do not take effect until
the MySQL server is restarted. In addition, these changes are not
stored in the instance manager's local cache of instance settings
until a `FLUSH INSTANCES' command is executed.
* `UNSET INSTANCE_NAME.OPTION_NAME'
This command removes an option from an instance's configuration
file.
mysql> UNSET mysqld2.port;
Query OK, 0 rows affected (0.00 sec)
Changes made to the configuration file do not take effect until
the MySQL server is restarted. In addition, these changes are not
stored in the instance manager's local cache of instance settings
until a `FLUSH INSTANCES' command is executed.
* `FLUSH INSTANCES'
This command forces IM to reread the configuration file and to
refresh internal structures. This command should be performed
after editing the configuration file. The command does not restart
instances.
mysql> FLUSH INSTANCES;
Query OK, 0 rows affected (0.04 sec)
Info Catalog
(mysql.info) instance-manager-configuration-files
(mysql.info) instance-manager
automatically generated byinfo2html