Skip to content

SHOW SUBSCRIPTIONS

Grammar Description

Returns all publish names, publish instance names, published database names, published time to the tenant, subscription name, and time to create the subscription.

Grammar Structure

SHOW SUBSCRIPTIONS [ALL];

Grammar Explanation

-ALL option can see all permissioned subscriptions. Unsubscribed sub_time, sub_name is null, without addingALL, you can only see the subscribed publication information.

Example

mysql> show subscriptions all;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| pub_name | pub_account | pub_database | pub_time | sub_name | sub_time |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| pub_mall | 018fb8d3_2b05_7be8_b526_bb62576dxxxx | new_pub | 2024-05-27 09:46:59 | NULL | NULL |
| pub_school | 018fb8d3_2b05_7be8_b526_bb62576dxxxx | school | 2024-05-27 09:20:13 | NULL | NULL |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
22 rows in set (0.10 sec)


mysql> show subscriptions;
Empty set (0.00 sec)

mysql> create database sub1 from 018fb8d3_2b05_7be8_b526_bb62576dxxxx publication pub_school;
Query OK, 1 row affected (0.02 sec)

mysql> show subscriptions all;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| pub_name | pub_account | pub_database | pub_time | sub_name | sub_time |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| pub_school | 018fb8d3_2b05_7be8_b526_bb62576dxxxx | school | 2024-05-27 09:20:13 | sub1 | 2024-05-27 10:39:12 |
| pub_mall | 018fb8d3_2b05_7be8_b526_bb62576dxxxx | new_pub | 2024-05-27 09:46:59 | NULL | NULL |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

mysql> show subscriptions;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| pub_name | pub_account | pub_database | pub_time | sub_name | sub_time |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| pub_school | 018fb8d3_2b05_7be8_b526_bb62576dxxxx | school | 2024-05-27 09:20:13 | sub1 | 2024-05-27 10:39:12 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 row in set (0.08 sec)