SHOW READWRITE_SPLITTING RULE

    语法

    • 未指定 databaseName 时,默认是当前使用的 DATABASE。 如果也未使用 DATABASE 则会提示 No database selected

    返回值说明

    • 查询指定逻辑库中的读写分离规则
    1. SHOW READWRITE_SPLITTING RULES FROM readwrite_splitting_db;
    1. mysql> SHOW READWRITE_SPLITTING RULES FROM readwrite_splitting_db;
    2. | name | auto_aware_data_source_name | write_data_source_name | read_data_source_names | load_balancer_type | load_balancer_props |
    3. +------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
    4. | ms_group_0 | | resource_1 | ds_0,ds_1 | random | |
    5. 1 row in set (0.01 sec)
    • 查询当前逻辑库中的读写分离规则
    1. mysql> SHOW READWRITE_SPLITTING RULES;
    2. +------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
    3. | name | auto_aware_data_source_name | write_data_source_name | read_data_source_names | load_balancer_type | load_balancer_props |
    4. +------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
    5. | ms_group_0 | | resource_1 | ds_0,ds_1 | random | |
    6. 1 row in set (0.01 sec)
    • 查询指定逻辑库中的指定读写分离规则
    1. SHOW READWRITE_SPLITTING RULE ms_group_0 FROM readwrite_splitting_db;
    • 查询当前逻辑库中的指定读写分离规则
    1. SHOW READWRITE_SPLITTING RULE ms_group_0;
    1. +------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
    2. | name | auto_aware_data_source_name | write_data_source_name | read_data_source_names | load_balancer_type | load_balancer_props |
    3. +------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+
    4. | ms_group_0 | | resource_1 | ds_0,ds_1 | random | |
    5. +------------+-----------------------------+------------------------+------------------------+--------------------+---------------------+

    保留字