码迷,mamicode.com
首页 > 数据库 > 详细

MySql: show databases/tables use database desc table

时间:2017-01-01 22:50:42      阅读:410      评论:0      收藏:0      [点我收藏+]

标签:sch   row   nbsp   char   man   extra   use   rman   tables   

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

标签:sch   row   nbsp   char   man   extra   use   rman   tables   

原文地址:http://www.cnblogs.com/alexyuyu/p/6241594.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!