NOTE: This module requires the MySQLdb python module and the proper settings in the minion config file. See salt.modules.mysql for more information.
The mysql_grants module is used to grant and revoke MySQL permissions.
The name you pass in purely symbolic and does not have anything to do with the grant itself.
The database parameter needs to specify a 'priv_level' in the same specification as defined in the MySQL documentation:
frank_exampledb:
mysql_grants.present:
- grant: select,insert,update
- database: exampledb.*
- user: frank
- host: localhost
frank_otherdb:
mysql_grants.present:
- grant: all privileges
- database: otherdb.*
- user: frank
restricted_singletable:
mysql_grants.present:
- grant: select
- database: somedb.sometable
- user: joe
Ensure that the grant is absent
Ensure that the grant is present with the specified properties