Home  >  Article  >  Backend Development  >  MySQL最常见的操作语句小结

MySQL最常见的操作语句小结

WBOY
WBOYOriginal
2016-06-10 15:13:061265browse

以下是我这几天一直在用的几个命令,先记下来,以后会整理一份mysql详细的使用文档
注:[]中代表名字,需要用库名或者表名替换
显示所有的库:

show databases;

进入某库:

use [dbname];

显示所有的表:

show tables;

显示某表的字段配置:

describe [tbname];


show full fields from [tbname];

创建库:

create database [dbname];

删除表:

drop database [dbname];

删除表:

drop table [tbname];

导入创建脚本:

mysql -u[user] -p [dbname] < [create.sql] 

(如果没有密码,则不需要-p)

显示每个表的数据存储量等状态:

show table status \G;

 就到这里。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn