\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的存储过程。存储过程