mysql数据导入

1.INSERT INTO SELECT语句

      语句形式为:Insert into Table2(field1,field2,...) select value1,value2,... from Table1

      要求目标表Table2必须存在

 2.SELECT INTO FROM语句

      语句形式为:SELECT vale1, value2 into Table2 from Table1

      要求目标表Table2不存在

3.MYSQL不支持Select * Into new_table_name from old_table_name;

  替代方法Create table new_table_name (Select * from old_table_name);

4.保存到文件
   select * into outfile "/tmp/payment_success.data" character set utf8 from payment_success where appid=200660011;
   select *  from payment_success where appid=200660011 into outfile "/tmp/payment_success.data" character set utf8;
5.从文件导入数据
   load data local infile "/tmp/payment_success.data" into table payment_success; 
6.mysqlimport
7.source

mysql数据导入,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。