Skip to content

Instantly share code, notes, and snippets.

@purplespider
Last active August 29, 2015 14:03
Show Gist options
  • Save purplespider/93029efc9344db3d1349 to your computer and use it in GitHub Desktop.
Save purplespider/93029efc9344db3d1349 to your computer and use it in GitHub Desktop.
Clone Remote (Live) MySQL Database to Local (Dev)
ssh [REMOTE-USER]@[REMOTE-SERVER] mysqldump -u [REMOTE-MYSQL-USER] -p[REMOTE-MYSQL-PASSWORD] [REMOTE-MYSQL-DATABASENAME] | mysql -u [LOCAL-MYSQL-USER] -p[LOCAL-MYSQL-PASSWORD] [LOCAL-MYSQL-DATABASENAME]
@matteomattei
Copy link

Nice! Just need to remove "`" at the end of the line.

@purplespider
Copy link
Author

Ha! You found this quickly! I was only testing out the possiblity of using Gist for code blocks on my new blog: http://www.jamescocker.net/clone-remote-mysql-database-to-local/ Decided against it though.

Ah yeh, I had seen that rogue character, removed.

@matteomattei
Copy link

eheh... Nice to meet you ;-)

I am also in the process of converting my code blocks to Gist.
My old blog is based on WP but now I am moving to Jekyll/Github and my temporary blog is http://matteomattei.github.io

When it will be read I will move the official DNS (matteomattei.com) to Github as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment