Mysql database of learning -- 1, access to raw data

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
show databases
show tables
information_schema
Output show tables statement does not contain the temporary table
To view all the database server
>show databases
For a given database create database statement
>show create database db_name
To view the default database table or a given database table
>show tables
>show tables from db_name
For a given database table create table statement
>show create table tbl_name
The column or index information view data table
>show columns from tbl_name
>show index from tbl_name
The following statement and the show columns from same as the tbl_name statement
>describe tbl_name
>explain tbl_name
To view the default database or a given database table descriptive information
>show table status
>show table status from db_name
Defines a scope to the output of the show statement, can also will support the like statement to where,
The where statement does not change the number of columns, only to change the output line number, if the data in the column name is a reserved word
You must use the backtick (`) in parentheses.
>show columns from tbl_name like '%s'
>show columns from tbl_name like '_s'
>show columns from tbl_name where `key`='pri'

The mysqlshow command

The mysqldump command
Management server database
mysqlshow
(if the display to refuse, will provide the host, username and password are shown as follows.,
If the host changed the default port must also provide port capital P -P)
>mysqlshow mysql -h localhost -u root -p
List the given database table
>mysqlshow db_name
For a given data table data column information
>mysqlshow db_name tbl_name
For a given data table index information
>mysqlshow --keys db_name tbl_name
Description of information for a given data in the database table
>mysqlshow --status db_name
List the structure information of data table given in the database (if not will also list all of the data in the table --no-data parameters)
>mysqldump --no-data db_name [tbl_name] -u root -p|more
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Alva at November 27, 2013 - 2:25 PM