简体   繁体   中英

Import remote sql.gz file to ClearDB database

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM