查看MySQL数据库表的命令介绍
如果需要查看MySQL數(shù)據(jù)庫(kù)中都有哪些MySQL數(shù)據(jù)庫(kù)表,應(yīng)該如何實(shí)現(xiàn)呢?下面就為您介紹查看MySQL數(shù)據(jù)庫(kù)表的命令,供您參考。
進(jìn)入MySQL Command line client下
查看當(dāng)前使用的數(shù)據(jù)庫(kù):
mysql>select database();
mysql>status;
mysql>show tables;
mysql>show databases;//可以查看有哪些數(shù)據(jù)庫(kù),返回?cái)?shù)據(jù)庫(kù)名(databaseName)
mysql>use databaseName; //更換當(dāng)前使用的數(shù)據(jù)庫(kù)
mysql>show tables; //返回當(dāng)前數(shù)據(jù)庫(kù)下的所有表的名稱
或者也可以直接用以下命令
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ù)庫(kù)表的命令介紹。
總結(jié)
以上是生活随笔為你收集整理的查看MySQL数据库表的命令介绍的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 没有GPS能查到车在哪里吗?
- 下一篇: Vtune工具简介