# mysql\_\* modules defaults from my.cnf

**URL:** <https://forum.ansible.com/t/mysql-modules-defaults-from-my-cnf/15698>\
**Category:** Ansible Project\
**Created:** [July 17, 2014, 7:18pm UTC](https://forum.ansible.com/t/mysql-modules-defaults-from-my-cnf/15698 "2014-07-17T19:18:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [July 17, 2014, 7:18pm UTC](https://forum.ansible.com/t/mysql-modules-defaults-from-my-cnf/15698/1 "2014-07-17T19:18:55Z")

</div>

Right now the various mysql\_\* modules will pull default connection  
information from the ~/.my.cnf file. This is especially important to  
make things repeatable especially when the server is newly provisioned  
and insecure.

But it doesn't use the socket information in the ~/.my.cnf file.  
Instead if your sever has the socket in a different spot you need to  
explicitly set it in every task. Not a huge deal, just slightly  
annoying when you don't need to specify the user/pw for each task.

Would a PR be accepted that would use the socket from .my.cnf as the  
login\_unix\_socket if one exists?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 18, 2014, 1:39am UTC](https://forum.ansible.com/t/mysql-modules-defaults-from-my-cnf/15698/2 "2014-07-18T01:39:33Z")

</div>

Sounds great, send us a PR!
