创建表:create table stuinfo(stuid int unsigned primarykey,stuname varchar(10) not null,gender char(1),birthdate date,class varchar(2),city varchar(20)
插入数据:insert into stuinfo(stuid,stuname,gender,class,city,major) values(20190001,"芦苇","男","3班","合肥","唱歌");
给表新增字段:alter table stuinfo add major varchar(20) after(before) 字段名;
删除字段:alter table stuinfo drop major ;
表重新命名:alter table stuinfo rename stuinfos;
查询结果导出:select * from stuinfo into outfile '目录' fields terminated by '分裂符号' lines terminated by '\r\n';
文件导入数据库:load data infile '文件路经' into table orders fields terminated by '\t' lines terminated by '\r\t';
错误:1290 - The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
处理方式:修改mysql配置文件my.ini中secure-file-priv的值,为空任意文件目录导出,配置目录为指定目录导入导出。