How can I transfer data between 2 MySQL databases?

前端 未结 5 1969
误落风尘
误落风尘 2020-12-14 08:08

I want to do that using a code and not using a tool like \"MySQL Migration Toolkit\". The easiest way I know is to open a connection (using MySQL connectors) to DB1 and read

5条回答
  •  隐瞒了意图╮
    2020-12-14 08:21

    from http://dev.mysql.com/doc/refman/5.0/en/rename-table.html:

    As long as two databases are on the same file system, you can use RENAME TABLE to move a table from one database to another:

    RENAME TABLE current_db.tbl_name TO other_db.tbl_name;
    

提交回复
热议问题