# MySQL module for initial review

**URL:** <https://forum.ansible.com/t/mysql-module-for-initial-review/11665>\
**Category:** Ansible Project\
**Created:** [July 11, 2012, 11:16pm UTC](https://forum.ansible.com/t/mysql-module-for-initial-review/11665 "2012-07-11T23:16:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Theunissen](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@Mark\_Theunissen](https://forum.ansible.com/u/Mark_Theunissen)\
**Post date:** [July 11, 2012, 11:16pm UTC](https://forum.ansible.com/t/mysql-module-for-initial-review/11665/1 "2012-07-11T23:16:05Z")

</div>

I’ve opened a pull request for an idempotent MySQL module. The user management stuff is working, and I will work on databases next. At the moment I’m just looking for feedback on coding style, approach, etc. as I’d like to get this into core.

[https://github.com/ansible/ansible/pull/580](https://github.com/ansible/ansible/pull/580)

Usage:

Ensure that a user named ‘bob’ exists with a password of ‘12345’:

> mysql user=bob passwd=12345 state=present

Ensure that the user ‘bob’ is removed:

> mysql user=bob state=absent

Ensure that the user ‘bob’ has all privileges on the ‘invoices’ database and SELECT,UPDATE on the ‘customer’ database:

> mysql user=bob priv=invoices._:ALL/customer._:SELECT,UPDATE state=present

All feedback welcome!

Thanks all  
Mark

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [July 11, 2012, 11:58pm UTC](https://forum.ansible.com/t/mysql-module-for-initial-review/11665/2 "2012-07-11T23:58:40Z")

</div>

Nice.

Since it doesn't do databases yet, I'm going to close the pull request for now…folks should still be able to look at the code from it, and I can still comment on it, but I don't want to apply it until it's good to go.
