When we need database from server to local system, we use backup_migrate module. If we have server information then we can do better. we have to run some commands and db would be downloaded, unzipped and old database would be replaced with new db. So…
- Download database.
- Now Unzip this bz2 file.
- Delete old database.
- Import new (recently downloaded) database.
that’s all.
Now we can remove mysql file by “rm db.sql”.
OR
Download https://gist.github.com/crazyrohila/6157902 script and edit server & mysql information and then run script. This script will ask for server password for ssh login. we can skip that step by putting our public key (~/.ssh/id_rsa.pub) in authorized_keys file on server, more info about it can be found here ssh login without password