2

I can import data.sql onto my foreign host with this command:

mysql -u username -p -h foreign-host.example.org -A DATA-BASE-NAME < data.sql

Which works fine for small export files, but I cannot find an explanation how to import a large file, so the transfer will be compressed.

2 Answers 2

3

Use the --compress flag.

mysql --compress -u username ...

--compress, -C

Compress all information sent between the client and the server if both support compression.

http://dev.mysql.com/doc/refman/5.6/en/mysql-command-options.html#option_mysql_compress

Virtually any MySQL client and server will support compression.

0

You can use gunzip:

Example:

gunzip < path_to_gzippedfile | mysql -u username -p -h hostname database_name.

1
  • but that would not send it compressed, which was the question
    – rubo77
    Nov 8, 2015 at 4:55

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.