Mysqlknife
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.
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
- Do not use this tool in production before testing it.
- Please, use when do you need.
- The author is NOT responsible for misuse use of this tool.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request