SHOW CREATE VIEW view_name
This statement shows a CREATE VIEW
statement that creates the given view.
mysql> SHOW CREATE VIEW v\G
*************************** 1. row ***************************
View: v
Create View: CREATE ALGORITHM=UNDEFINED
DEFINER=`bob`@`localhost`
SQL SECURITY DEFINER VIEW
`v` AS select 1 AS `a`,2 AS `b`
character_set_client: latin1
collation_connection: latin1_swedish_ci
character_set_client is the session value
of the character_set_client system variable
when the routine was created.
collation_connection is the session value
of the collation_connection system variable
when the routine was created. These columns were added in
MySQL 5.1.21.
Use of SHOW CREATE VIEW requires the
SHOW VIEW privilege and the
SELECT privilege for the view in question.
You can also obtain information about view objects from
INFORMATION_SCHEMA, which contains a
VIEWS table. See
Section 27.15, “The INFORMATION_SCHEMA VIEWS Table”.

User Comments
Add your own comment.