db1为原数据库,db2为要导出到的数据库,fromtable 是要导出的表名

1.方法一:
登录导出到的数据库,执行
create table fromtable select * from db1.fromtable;
2.方法二:
在cmd下执行,mysqldump -u root -p db1 fromtable file=d:/fromtable.sql; 输入秘密,root为用户名
登录db2 执行 source d:/fromtable.sql;
3.方法三:
登录db1 执行 select * from fromtable into outfile "d:/fromtable .txt"; 导出纯数据格式
登录db2 执行 load data infile d:/fromtable .txt into table fromtable; 需要先建一张和原表结构一样的空表。
4.建一个odbc连接,先导出到access中,再导出到另一个库中。

5.insert into 表1(字段1,字段2,....) select 字段1,字段2,.... from 表2 where 条件;

相关文章:

  • 2021-10-13
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-04-05
  • 2021-09-01
猜你喜欢
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
相关资源
相似解决方案