-
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)