Synthesis : Scott Becker

New Plugin: MySQL Tasks

I wrote some convenience rake tasks to automate creation and backup of MySQL databases, and I use it all the time, so I figured I’d plugin-afy it to make it simple to use in all my projects, and share it with the world as well! Here’s the repository

MySQL Tasks

Some rake tasks to automate common database tasks (create/destroy & backup/restore).

Install

./script/plugin install http://sbecker.net/shared/plugins/mysql_tasks

Components

rake db:mysql:create           # Create database (using database.yml config)
rake db:mysql:destroy          # Destroy database (using database.yml config)
rake db:mysql:backup           # Dump schema and data to an SQL file (/db/backup_YYYY_MM_DD.sql)
rake db:mysql:restore          # Load schema and data from an SQL file (/db/restore.sql)

Specifying RAILS_ENV works if you want to perform operations on test or production databases.

 

Comments are closed.