Mysql Facts¶
mysql.MysqlDatabases
¶
host.get_fact(MysqlDatabases, mysql_user=None, mysql_password=None, mysql_host=None, mysql_port=None)
rns a dict of existing MySQL databases and associated data:
ode:: python
- {
- “mysql”: {
“character_set”: “latin1”, “collation_name”: “latin1_swedish_ci”
},
}
mysql.MysqlUserGrants
¶
host.get_fact(MysqlUserGrants, user, hostname='localhost', mysql_user=None, mysql_password=None, mysql_host=None, mysql_port=None)
rns a dict of <database>`.<table>
with a set of granted privileges for each:
ode:: python
- {
- “pyinfra_stuff.*”: {
“SELECT”, “INSERT”, “GRANT OPTION”,
},
}
mysql.MysqlUsers
¶
host.get_fact(MysqlUsers, mysql_user=None, mysql_password=None, mysql_host=None, mysql_port=None)
rns a dict of MySQL user@host
’s and their associated data:
ode:: python
- {
- “user@host”: {
“privileges”: [“Alter”, “Grant”], ‘max_connections’: 5, …
},
}