# AttributeError: 'module' object has no attribute 'cursors'

**URL:** <https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-cursors/29019>\
**Category:** Ansible Project\
**Created:** [November 13, 2018, 2:38pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-cursors/29019 "2018-11-13T14:38:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Son\_T](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Son\_T](https://forum.ansible.com/u/Son_T)\
**Post date:** [November 13, 2018, 2:38pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-cursors/29019/1 "2018-11-13T14:38:31Z")

</div>

This is the error I get when using proxysql\_manage\_config module as documented here: [https://docs.ansible.com/ansible/2.5/modules/proxysql\_manage\_config\_module.html](https://docs.ansible.com/ansible/2.5/modules/proxysql_manage_config_module.html)

Anyone know how I get around this issue?

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [November 13, 2018, 9:51pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-cursors/29019/2 "2018-11-13T21:51:13Z")

</div>

Without showing the actual playbook, that’s going to be difficult.

So, what does the playbook look like?

Dick

---

<div class="post-metadata">

**Author:** ![Son\_T](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Son\_T](https://forum.ansible.com/u/Son_T)\
**Post date:** [November 14, 2018, 8:50am UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-cursors/29019/3 "2018-11-14T08:50:14Z")

</div>

Not much, the task in the playbook was simplified as per example:

- name: Create proxysql user in proxy database  
proxysql\_mysql\_users:  
login\_user: “{{ proxysql\_admin\_user }}”  
login\_password: “{{ proxysql\_admin\_password }}”  
username: “{{ test\_user }}”

password: “{{ test\_user\_pass }}”  
state: present  
load\_to\_runtime: true  
save\_to\_disk: true

But this still errors with that message: attributeError: ‘module’ object has no attribute ‘cursors’. Googling around, I found this article: [http://www.gadzmo.com/python/using-pythons-dictcursor-in-mysql-to-return-a-dict-with-keys/](http://www.gadzmo.com/python/using-pythons-dictcursor-in-mysql-to-return-a-dict-with-keys/)

I wonder if this a simple fix in the module code to '`import` `MySQLdb.cursors'..?`

---

<div class="post-metadata">

**Author:** ![dymofo](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dymofo](https://forum.ansible.com/u/dymofo)\
**Post date:** [November 22, 2018, 7:08pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-cursors/29019/4 "2018-11-22T19:08:08Z")

</div>

Did you find the solution?  
I have the same issue after ansible 2.7 upgrade.

---

<div class="post-metadata">

**Author:** ![Son\_T](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Son\_T](https://forum.ansible.com/u/Son_T)\
**Post date:** [January 1, 2019, 11:57am UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-cursors/29019/5 "2019-01-01T11:57:33Z")

</div>

No, I had to perform task using ‘shell’.
