Run a query and grab the output.

Search/replace in vim.

Save as a PHP script that issues updates in batches of n.


I've done this to move sites to new servers when the respective mySQL boxes couldn't talk to each other.