图解MySQL常用命令

2025-12-30 03:16:58

1、创建数佛英据库

命令 create database 数据库名 charset=utf8; 

图解MySQL常用命令

2、显示数据库

命令 show databases;

图解MySQL常用命令

3、指定数据库 

命令 use 数据库名;

图解MySQL常用命令

4、看当前使用泰愁数据库

命令 select database();

图解MySQL常用命令

5、删除数据库

命令 drop database 数据库名;

图解MySQL常用命令

6、创建表

命令 create table 表名(列及类型);

其中auto_increment表示况扬泉自动增长

图解MySQL常用命令

7、显示表

命令 show tables;

图解MySQL常用命令

8、显示字段

命令 desc 表名;

图解MySQL常用命令

9、新增字段

命令 alter table 表名 add 字段;

图解MySQL常用命令

10、添加数据

全列插入

命令 insert into 表名 values();

图解MySQL常用命令

11、缺省插入

命令 insert into 表名(列1,列2,...) values(值1,值2,...);

图解MySQL常用命令

12、查看内容

命令 select * from 表名;

图解MySQL常用命令

13、修改表

命令 update 表名 set 列1=值1 where 条件;

图解MySQL常用命令

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢