Thursday, March 17, 2011

Bash functions to dump and load a mysql database

Everyone probably has one of these, but here is mine. It's a bit rough but works for me. If I was going to make it better I'd probably use getopt instead of $1 and $2 and then add options for changing the mysql user. (Currently it hard codes the user as root). Put it in your .bash_aliases or .bashrc or wherever you keep these types of things. Update: I made a set of rake tasks for doing this kind of thing, so I'm not actually using this any more.

No comments: