使用实例管理器轻松管理多个MySQL实例
2009-04-10 11:17:47 来源:WEB开发网4、连接IM
[root@localhost ~]# mysql -uuser_all -p -S/tmp/manager.sock -P1999
三、用IM来管理MySQL数据库
1、显示实例的状态和版本信息
[root@localhost ~]# mysql -uuser_all -p -S/tmp/manager.sock -P1999
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 1.0-beta
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> show instances;
+---------------+--------+
| instance_name | state |
+---------------+--------+
| mysqld1 | online |
| mysqld2 | online |
+---------------+--------+
2 rows in set (0.00 sec)
关闭实例1
mysql> stop instance mysqld1;
Query OK, 0 rows affected (0.30 sec)
mysql> show instances;
+---------------+---------+
| instance_name | state |
+---------------+---------+
| mysqld1 | offline |
| mysqld2 | online |
+---------------+---------+
2 rows in set (0.00 sec)
开启实例1
mysql> start instance mysqld1;
Query OK, 0 rows affected (0.00 sec)
Instance started
mysql> show instances;
+---------------+--------+
| instance_name | state |
+---------------+--------+
| mysqld1 | online |
| mysqld2 | online |
+---------------+--------+
2 rows in set (0.00 sec)
更多精彩
赞助商链接