The mysqldump client program allows you to see the structure of your tables in the form of a CREATE TABLE statement (much like SHOW CREATE TABLE). The mysqlshow command provides some of the same information as the SHOW statement, which allows you to get database and table information at your command prompt:ĭisplay information about columns in a table:ĭisplay information about indexes in a table:ĭisplay descriptive information about tables in a database: Generally, this is done to match a literal '_',which occurs frequently in database, table, and column names. To match a literal instance of a wildcard character in a LIKE pattern, precede it with a backslash. For example, this statement displays the names of tables in the current database that begin with 'geo': SHOW TABLES LIKE 'geo%' MySQL interprets ' pattern' as an SQL pattern that may include the '%' and '_' wildcard characters. Several forms of the SHOW statement take a LIKE ' pattern' clause allowing a pattern to be given that limits the scope of the output. SHOW TABLE STATUS SHOW TABLE STATUS FROM db_name ĭisplay descriptive information about tables in the current database or in a given database:.The DESCRIBE tbl_name and EXPLAIN tbl_name statements are synonymous with SHOW COLUMNS FROM tbl_name. SHOW COLUMNS FROM tbl_name SHOW INDEX FROM tbl_name ĭisplay the CREATE TABLE statement for a table:ĭisplay information about columns or indexes in a table:.Note that SHOW TABLES doesn't show TEMPORARY tables. List the tables in the current database or in a given database: List the databases managed by the server:ĭisplay the CREATE DATABASE statement for a database: SHOW is helpful for keeping track of the contents of your databases and for reminding yourself about the structure of your tables: MySQL provides a SHOW statement that has several variant forms that display information about databases and the tables in them. Learn More Buy Getting Information About Databases and Tables
0 Comments
Leave a Reply. |