create table MyClass(
> id int(4) not null primary key auto_increment,
> name char(20) not null,
> sex int(4) not null default '0',
> degree double(16,2));
CREATE DATABASE `test`;
INSERT INTO tbl_name (col1,col2) VALUES(15,col1*2);
insert into teamstemp select * from teams;
insert into table_a(field_a1,field_a2,field_a3) select field_b1,field_b2,field_b3) from table_b;
rename table teams to teams_ready_to_drop;
show processlist;
kill id;
mysql -u root -p -e "select concat('KILL ',ID,';') from information_schema.processlist where COMMAND='Sleep';" | cat
mysql -u root -p -e "select concat('KILL ',ID,';') from information_schema.processlist where COMMAND='Sleep' and time > 259200;" | cat
select * from abc_def into outfile "/tmp/abcdef.sql.925";
select id,the_date,a_name,b_cumsum,c_cumsum,d_spent,e_rate,created_at,updated_at abc_def into outfile "/tmp/tmp_xyz.sql.2";
mysql> select concat('optimize table ',TABLE_SCHEMA,'.',TABLE_NAME,';') from information_schema.TABLES where (ENGINE='MyISAM' or ENGINE='InnoDB') and TABLE_SCHEMA!='information_schema' and TABLE_SCHEMA!='mysql' into outfile "/tmp/optimize.sql";
Query OK, 365 rows affected (0.09 sec)
mysql>
load data infile "/tmp/abcdef.sql.925.2" into table abc_def;
use xxx;
source fff.sql;
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。