2

I have a ".SQL" file which contains data at a remote server. I could download that file to my local machine and import data in my local DB, but because of network issues, and the size of ".sql" file (6.7GB) it's taking forever.

Is there any way I could execute the restore command on remote server and tunnel the output to my local machine DB ?

Thanks for help !

2 Answers 2

4

You should gzip the file.

gzip DataFile.sql

Then, download it to the local machine.

Once it is on the local machine, run the following:

gzip -d < DataFile.sql.gz | mysql -uroot -p... ...

If you would rather import through the tunnel, try this on the remote server:

mysql -h<IP of your machine> -uroot -p... < DataFile.sql

If you local Linux machine has a firewall, run this

service iptables stop

then run the import. Finally, run this on your local box and put up the firewall

service iptables start
1
  • 1
    is there no way i can execute mysql -uroot -p < sql.sql and tunnel the out put to my local machine ? Commented May 1, 2012 at 19:50
0

SO question with the remote command. The bottleneck is related to your network speed. Forever is slightly too long. Due to the size, try and compress the file remotely and then download it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.