zl程序教程

您现在的位置是:首页 >  其他

当前栏目

Mycat 管理命令1

2023-03-31 10:28:49 时间

前言

Mycat 是一款开源的数据库分库分表中间件

可以通过 Mysql 命令行,登录 9066 端口执行 SQL 的方式来进行管理

事实上目前的管理命令集更多是用来进行查看和分析,里面包含很多有价值的统计数据,但是对 Mycat 实例的操作命令还相对较少

这里分享一下 Mycat 相关管理操作,详细内容可以参考 官方文档

Tip: 当前的最新版本为 Mycat server 1.5 GA


概要


管理端口

正常启动 mycat 后,会在本地打开 80669066 两个端口,其中:

  • 8066 用作数据交互
  • 9066 用作mycat管理
[root@h102 conf]# grep 66 server.xml 
			<property name="serverPort">8066</property> <property name="managerPort">9066</property> 
[root@h102 conf]# netstat  -ant | grep 66
tcp        0      0 :::8066                     :::*                        LISTEN      
tcp        0      0 :::9066                     :::*                        LISTEN      
[root@h102 conf]# 

这个端口可以在启动前自定义


登录管理口

管理台的登录方式与普通mysql登录无异

[root@h102 conf]# mysql -u cc -p -P 9066 -h 192.168.100.102
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.5.8-mycat-1.5-GA-20160217103036 MyCat Server (monitor)

Copyright (c) 2000, 2016, 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.

mysql> 

Arg

Comment

-u

server.xml 中配置的逻辑用户名

-p

server.xml 中与逻辑用户名应对的密码

-P

指定连接端口

-h

指定mycat实例的主机名

可以看到和mysql的登录没有不同