MySQL Forums
Forum List  »  Backup

Re: import remote database by connect to remote service
Posted by: Rick James
Date: July 17, 2014 04:21PM

If you can remotely connect a mysql client on 3306 to the mysql server, then you can do 'everything'. mysqldump is just another "mysql client".

mysqldump -h server ... >foo.sql -- dumps database(s) on remote "server" to a file on your local machine
mysql -h server ... <foo.sql -- uses that local file to repopulate the remote "server".
(Note the "..." is other parameters, options, etc, as needed.)

There must be no writes while running mysqldump, otherwise you may have inconsistencies in the dump. One way is to run, separate thread, FLUSH TABLES WITH READ LOCK;. Dump utility packages often include such.

The above syntax works in both Unix and Windows.

workbench, phpmyadmin, ssh, etc are not needed.

> I tried once to make the dump, but the result was a file .sql corrupt

Need details to analyze. I have done stuff like this for servers much bigger than 2GB, even on 32-bit operating systems. However, you have to get a _really_old system that cannot write/read a file bigger than 2GB -- like 20 years old!

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: import remote database by connect to remote service
4241
July 17, 2014 04:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.