批量KILL会话:
1.首先,根据条件将查询到要kill的进程写入文件;如:
desc information_schema.processlist;
SELECT concat('KILL ',id,';') FROM information_schema.processlist WHERE user='root'; 或者根据status
SELECT concat('KILL ',id,';') FROM information_schema.processlist WHERE user='root' INTO OUTFILE '/tmp/a.txt';
2.然后倒入这个文件,即可kill掉mysql进程:
source /tmp/a.txt;
http://blog.163.com/yang_jianli/blog/static/161990006201231124951692/
批量导入CSV等文件数据
1、首先对应文件列建好表
2、执行下面命令
load data local infile 'e:\test.csv'
into table test_table
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '
';