美文网首页
mysql---基础命令

mysql---基础命令

作者: 古寒飞 | 来源:发表于2017-03-13 13:48 被阅读14次

#建库---

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}');"

相关文章

网友评论

      本文标题:mysql---基础命令

      本文链接:https://www.haomeiwen.com/subject/haifnttx.html