MySQL Maintenance Buddy is a ruby command line application for automated MySQL backups, restores and daily maintenance jobs.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
backups
config
lib
log
.gitignore
README.textile
mysqlmb

README.textile

MySQL-Maintenance-Buddy

MySQL-Maintenance-Buddy is a application which handles MySQL database backups
and database optimization for daily maintenance.

Copyright © 2009, Nik Wolfgramm

Features

  • create MySQL backups using mysqldump for all or some databases
  • restore databases from backups
  • optimize database tables using mysqlcheck
  • delete old database backups based on retention time
  • show current databases and backups
  • collect some maintenance stats such as duration of maitenance and number of db’s backed up
  • send a maintenance summary by email
  • log actions to logfile

See mysqlmb.rb —usage for a full list of options

Usage

Launch the ruby script:
mysqlmb COMMAND [options]

See mysqlmb -? for usage.

Requirements

List of dependencies:

  • Ruby
  • MySQL tools (mysql, mysqldump, mysqlcheck)
  • command line with some standard utilities (echo, bzip2)

Installation

  • Download mysqlmb and move it to the desired application directory (i.e. /usr/local/mysqlmb)
  • Create a symlink in order to have mysqlmb in your execution path
    • ln -s /usr/local/mysqlmb/mysqlmb /usr/local/sbin/mysqlmb
  • Have a mysql user with backup/optimization rights available
    • Minimal rights for backups: SELECT, RELOAD
    • for optimizations: LOCK TABLES
    • example user creation with mysql cmd-tool: GRANT SELECT, RELOAD, LOCK TABLES ON *.* TO backup@localhost IDENTIFIED BY 'password';
  • start automating MySQL maintenance tasks using MySQL-Maintenance-Buddy!