登录 Mysql
mysql -u 用户名 -p
密码
显示数据库
show databases;
使用数据库
use 数据库名;
显示可用表
show tables;
查询其他表
show tables from 其他表名;
查看数据库
select database();
创建表
create table 表名(
字段名 类型,
字段名 类型(长度)
);
查看表结构
desc 表名;
插入数据
insert into 表名(字段名,...,字段名) values (值1,...,值n);
修改表的数据
update 表名 set 字段名=值 where 字段名=值;
删除表中数据
delete from 表名 where 字段名=值;
查看版本信息
select version();
2021-01-02