\g的做用和MySQL中的分號」;"是同樣;mysql
\G的做用是講查找到的內容結構旋轉90度,變成縱向結構;sql
下面舉例說明,查找數據庫中的存在的存儲過程狀態:數據庫
SHOW PROCEDURE STATUS LIKE '%pricing%'\gci
具體以下所示:it
mysql> SHOW PROCEDURE STATUS LIKE '%pricing%'\g
+-------+----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+-------+----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| my_db | productpricing | PROCEDURE | root@localhost | 2019-03-27 14:03:00 | 2019-03-27 14:03:00 | DEFINER | | utf8 | utf8_general_ci | utf8_general_ci |
+-------+----------------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
1 row in set (0.00 sec)io
把\g替換成\G後,以下所示:cli
mysql> show PROCEDURE STATUS LIKE '%pricing%'\G
*************************** 1. row ***************************
Db: my_db
Name: productpricing
Type: PROCEDURE
Definer: root@localhost
Modified: 2019-03-27 14:03:00
Created: 2019-03-27 14:03:00
Security_type: DEFINER
Comment:
character_set_client: utf8
collation_connection: utf8_general_ci
Database Collation: utf8_general_ci
1 row in set (0.00 sec)數據
這樣就一目瞭然的知道了有一個名稱爲productpricing的存儲過程。存儲過程