MySQL - No IO (Pronounced: mysql no-yo)

Executing export and maintenance commands which require you hold a connection to MySQL. The best use case example is running FLUSH TABLES WITH READ LOCK in one terminal while running an lvm snapshot in another.

Project State

Master Unit Tests: Build Status

Master Code Quality: Code Climate

Develop Unit Tests: Build Status

Beta, Basic functionality exists and it is being used in production for providing database dumps and backups.

Usage

The idea is similar to sudo: you pass a variety of options, and then the command you want to run afterward.

Examples:

mysql-noio -uroot -pfoobar --stop-slave --lock-tables -- ./my-snapshot.sh
# my-snapshot.sh
mysql -uroot -pfoobar -e "show slave status\G"
lvcreate -L20G -s -n mysqlsnap /dev/VG_MySQL/LV_MySQL

Dependencies

  • Ruby 1.9.3 (Ubuntu 12.04 installs this with the ruby1.9.1 package) or 2.0.0
  • The mysql2 gem, which also requires local mysql client libraries, and headers.

Installation

gem install mysqlnoio

Changelog

  • 2013-04-23 - First release (0.1.0).
  • 2013-04-23 - Fixed an issue where calling it with no parameters caused a stack trace.
  • 2013-04-23 - Created more extensive integration tests asserting the slave stop feature works as intended.
  • 2013-04-23 - Release: 0.1.1
  • 2013-04-25 - Client now pings the server every one second to prevent client timeouts during long-running subprocesses.
mysqlnoio - For executing commands with a stopped slave.
Copyright (C) 2013  ZippyKid

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.