Copy the contents of the mysql table from one server to another.

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

I can copy a table from one database to another database on the server, but I can not do this for different servers.

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

Everything I do to reduce the load on the server so that I can copy the table information to another server and run my queries there ...

+4
source share
2 answers

You can dump the table using mysqldump and import the dumped file on another server:

 mysqldump - root -p db1 tabletoexp > table.sql 

and on the other hand:

 mysql -u root -p db2 < table.sql 
+8
source

You can export the entire database, if the size is small, you can only export the database structure. When you select Db in phpmysql, there is one link called export.

Click on it, save it in one file. and import the same file to another server.

0
source

Source: https://habr.com/ru/post/1411504/


All Articles