Mysqlknife Build Status

MySQL Knife is a Ruby Gem and command line tools, written for MAC OS because use iTerm2 to set tab colors on terminal. That allows many connections bookmark and tasks for MySQL Administration. You can:

  • Connections bookmark.
  • Connections over SSH.
  • Run command on active connection.

mysqlknife

Installation

Install this tool executing the following command:

$ gem install mysqlknife

Configuration:

Create this file in yours home directory:

$ vim ~/.db.yml

Put this lines into file:

ssh:
  user: root
  host: demo.com
  port: 22
  keys: '~/.ssh/default.pem'

commands:
  innotop:
    'innotop -h #{host} -u #{username} #{password}'
  lag:
    'mysql -h #{host} -u #{username} #{password} --execute="SHOW SLAVE STATUS\G"'

databases:
  localhost:
    ssh: false
    color: green
    port: 3306
    host: 127.0.0.1
    username: root
    password: admin

  devel:
    ssh: false
    color: orange
    port: 3306
    host: master.demo.com
    username: root
    password: admin
    slaves:
      - devel-mysql-slave01.demo.com
      - devel-mysql-slave02.demo.com

  prod:
    ssh: true
    color: red
    port: 3306
    host: prod-mysql-master.demo.com
    username: root
    password: admin
    slaves:
      - prod-mysql-slave01.demo.com
      - prod-mysql-slave02.demo.com

Warning

  1. Do not use this tool in production before testing it.
  2. Please, use when do you need.
  3. The author is NOT responsible for misuse use of this tool.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request