关于数据库:腾讯云TDSQL-MySQL版-开发指南-数据库管理语句

44次阅读

共计 1599 个字符,预计需要花费 4 分钟才能阅读完成。

状态查问
通过 SQL 能够查看 proxy 的配置以及状态信息,目前反对如下命令:

/proxy/help;
/proxy/show config;
/proxy/show status;
阐明:
如果应用 MySQL 客户端,须要在应用客户端时减少 - c 选项,如 mysql -hxxx.xxx.xxx.xxx -Pxxxx -uxxx -pxxx -c。

示例如下:

mysql> /proxy/help;
commanddescription
show configshow config from conf
show statusshow proxy status,like route,shardkey and so on
set sys_log_level=Nchange the sys debug level N should be 0,1,2,3
set inter_log_level=Nchange the interface debug level N should be 0,1
set inter_time_open=Nchange the interface time debug level N should be 0,1
set sql_log_level=Nchange the sql debug level N should be 0,1
set slow_log_level=Nchange the slow debug level N should be 0,1
set slow_log_ms=Nchange the slow ms
set log_clean_time=Nchange the log clean days
set log_clean_size=Nchange the log clean size in GB

10 rows in set (0.00 sec)

mysql> /proxy/show config;
config_namevalue
versionV2R120D001
modegroup shard
rootdir/shard_922
sys_log_level0
inter_log_level0
inter_time_open0
sql_log_level0
slow_log_level0
slow_log_ms1000
log_clean_time1
log_clean_size1
rw_split1
ip_pass_through0

14 rows in set (0.00 sec)

mysql> /proxy/show status;
status_namevalue
clustergroup_1499858910_79548
set_1499859173_1:ip10.49.118.165:5025;10.175.98.109:5025@1@IDC_4@0,10.231.23.241:5025@1@IDC_2@0
set_1499859173_1:hash_range0—31
set_1499911640_3:ip10.49.118.165:5026;10.175.98.109:5026@1@IDC_4@0,10.231.23.241:5026@1@IDC_2@0
set_1499911640_3:hash_range32—63
setset_1499859173_1,set_1499911640_3

同时 proxy 加强了 explain 的返回后果,显示 proxy 批改后的 SQL。

mysql> explain select * from test1;
idselect_typetabletypepossible_keyskeykey_lenrefrowsExtrainfo
1SIMPLEtest1ALLNULLNULLNULLNULL16 set_2,explain select * from shard.test1
1SIMPLEtest1ALLNULLNULLNULLNULL16 set_1,explain select * from shard.test1

2 rows in set (0.03 sec)

正文完
 0