mysql---基础命令

#建库---

create database tay

-> character set=utf8

-> collate=utf8_general_ci;


#建表---

create table student(

-> id int primary key auto_increment,

-> name varchar(20) not null,

-> age int not null,

-> address varchar(50) not null

-> );


#删库---drop database <数据库名>;

#删表---drop table <表名>;


#增---insert into student (name,age,address) values ("孙悟空",25,"花果山");

#删---delete from student where id=1;

#改---update student set name=555,age=555,address=555 where id=53;

#查---select * from student;


#使用shell查询数据库

#---mysql -uroot -pTay123.. -e "use tay;select * from student;"

#使用shell自动添加10万条数据

#---mysql -uroot -pTay123.. -e "use tay;insert into student (name,age,address) values ('${i}',${i},'${i}');"

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容