简体   繁体   中英

Copy a mysql table content from one server to another server

How to copy a table from server A database db1 to server B database db2 ?

I am able to copy a table from one database to another database within the server, but not able to do for across servers.

CREATE TABLE recipes_new LIKE production.recipes; 
INSERT recipes_new SELECT * FROM production.recipes;

The whole thing I am doing it to reduce the server load so that I can copy table info into another server and run my queries there...

You can dump the table with mysqldump and import the dumped file in the other Server :

mysqldump - root -p db1 tabletoexp > table.sql

and on the other side :

mysql -u root -p db2 < table.sql

You can export whole database if size is small else you can export only structure of database. When you select Db in phpmysql, There is one link called export.

Click on it, save it into one file . and import the same file in other server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM