Gratan
Gratan is a tool to manage MySQL permissions.
It defines the state of MySQL permissions using Ruby DSL, and updates permissions according to DSL.
Installation
Add this line to your application's Gemfile:
gem 'gratan'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gratan
Usage
gratan -e -o Grantfile
vi Grantfile
gratan -a --dry-run
gratan -a
Help
Usage: gratan [options]
--host HOST
--port PORT
--socket SOCKET
--username USERNAME
--password PASSWORD
--database DATABASE
-a, --apply
-f, --file FILE
--dry-run
-e, --export
--with-identifier
--enable-expired
--split
-o, --output FILE
--ignore-user REGEXP
--no-color
--debug
--auto-identify OUTPUT
--csv-identify CSV
-h, --help
Grantfile example
require 'other/grantfile'
user "scott", "%" do
on "*.*" do
grant "USAGE"
end
on "test.*" do
grant "SELECT"
end
end
user "scott", "localhost", expired: '2014/10/10' do
on "*.*" do
grant "USAGE"
end
on "test.*" do
grant "SELECT"
end
end

