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)

posted @ 2017-01-01 21:50  alxe_yu  阅读(530)  评论(0编辑  收藏  举报