Last Updated: February 25, 2016
· rainphp

Import big MySql databases with command line

SSH your server and dump the database in your website folder

ssh 'mysqldump -u db_username -p db name > /var/www/vhosts/'

download filename.sql with curl

curl -Ov

and finally import into your local database

mysql -p -u db_username db_name < filename.sql

If you use MAMP your mysql is here


Note: you may want to use rsync instead of curl