手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

MySQL多实例部署案例

[日期:2012-11-06] 来源:Linux社区  作者:qiuzhijun [字体:大 中 小]

我们还可以查看下各实例的监听端口:
 
[root@MySQL5_10 ~]# netstat -ntlp |grep mysql
 
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                  LISTEN      3463/mysqld       

tcp        0      0 0.0.0.0:3307                0.0.0.0:*                  LISTEN      9674/mysqld 

客户端登录各实例:
 
[root@MySQL5_10 ~]# mysql -S /data/mysql/data3306/sock/mysql.sock

Welcome to the MySQL monitor.  Commands end with ; or \g.
 
Your MySQL connection id is 4
 
Server version: 5.5.25-log Source distribution
 
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
 
affiliates. Other names may be trademarks of their respective
 
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
(root:MySQL5_10@qzhijun: 10:30:46)[(none)]> show databases;
 
+--------------------+
 
| Database          |
 
+--------------------+
 
| information_schema |
 
| mysql              |
 
| performance_schema |
 
| test              |
 
+--------------------+
 
4 rows in set (0.03 sec)
 
(root:MySQL5_10@qzhijun: 10:31:07)[(none)]> \q
 
[root@MySQL5_10 ~]# mysql -S /data/mysql/data3307/sock/mysql.sock

Welcome to the MySQL monitor.  Commands end with ; or \g.
 
Your MySQL connection id is 2
 
Server version: 5.5.25-log Source distribution
 
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
 
affiliates. Other names may be trademarks of their respective
 
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
(root:MySQL5_10@qzhijun: 10:31:34)[(none)]>
 
 一个简单和多实例到此OK........

linux
相关资讯       MySQL基础教程  MySQL实例  MySQL多实例 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款