Import remote sql.gz file to ClearDB database

1.1k Views Asked by At

I have a large database dump on some server, for example:

http://url.to/database.sql.gz

and want to import it to ClearDB. It's quite large file, and I would like to do this without downloading and uploading that file again.

Note that I don't have access to the old database, just this file. The new database is used with Heroku.

1

There are 1 best solutions below

0
On

From the console where do you have the file do

root@server# mysql -h us-cdbr-azure-west-b.cleardb.com -u usernmae -p database < file.sql

The prompt will ask for password then the file will load from local server to the cleardb server.

If you want to send the process to the background using CTRL+Z then write bg.

I load a 3G sql file and work for me. Hope this work for you.