How to download a live MySQL db into a local test db on demand, without SSH?

Mar 12, 2012   //   by   //   Blog, PHP Tutorial  //  No Comments

Since you can access your database remotely, you can use mysqldump from your windows machine to fetch the remote database. From commandline:

cd "into mysql directory"
mysqldump -u USERNAME -p -h YOUR_HOST_IP DATABASE_TO_MIRROR >c:\backup\database.sql

The program will ask you for the database password and then generate a file c:\backup\database.sql that you can run on your windows machine to insert the data.

With a small database that should be fairly fast.

Leave a comment

Share This Post

RSS Wordpress News