MySql: show databases/tables use database desc table
Posted alxe_yu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySql: show databases/tables use database desc table相关的知识,希望对你有一定的参考价值。
1. show databases
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
2. use database_name
mysql> use test
Database changed
3. show tables
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| user |
+----------------+
1 row in set (0.00 sec)
4. desc table_name
mysql> desc user;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id | varchar(20) | NO | PRI | NULL | |
| name | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.09 sec)
以上是关于MySql: show databases/tables use database desc table的主要内容,如果未能解决你的问题,请参考以下文章