\g的作用和MySQL中的分號”;"是一樣;
\G的作用是講查找到的內容結構旋轉90度,變成縱向結構;
下面舉例說明,查找數據庫中的存在的存儲過程狀態:
SHOW PROCEDURE STATUS LIKE '%pricing%'\g
具體如下所示:
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)
把\g替換成\G后,如下所示:
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的存儲過程。