查看MySQL数据库表的命令介绍
如果需要查看MySQL數(shù)據(jù)庫中都有哪些MySQL數(shù)據(jù)庫表,應該如何實現(xiàn)呢?下面就為您介紹查看MySQL數(shù)據(jù)庫表的命令,供您參考。
進入MySQL Command line client下
查看當前使用的數(shù)據(jù)庫:
mysql>select database();
mysql>status;
mysql>show tables;
mysql>show databases;//可以查看有哪些數(shù)據(jù)庫,返回數(shù)據(jù)庫名(databaseName)
mysql>use databaseName; //更換當前使用的數(shù)據(jù)庫
mysql>show tables; //返回當前數(shù)據(jù)庫下的所有表的名稱
或者也可以直接用以下命令
mysql>show tables from databaseName;//databaseName可以用show databases得來
mysql查看表結(jié)構(gòu)命令,如下:
desc 表名;
show columns from 表名;
或者
describe 表名;
show create table 表名;
或者
use information_schema
select * from columns where table_name='表名';
查看警告:
Rowsmatched:1Changed:0Warnings:1
mysql>showwarnings;
+---------+------+-------------------------------------------+
|Level|Code|Message|
+---------+------+-------------------------------------------+
|Warning|1265|Datatruncatedforcolumn'name'atrow3|
+---------+------+-------------------------------------------+
1rowinset
以上就是查看MySQL數(shù)據(jù)庫表的命令介紹。
總結(jié)
以上是生活随笔為你收集整理的查看MySQL数据库表的命令介绍的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 没有GPS能查到车在哪里吗?
- 下一篇: Vtune工具简介