# Failed to find required executable mysql

**URL:** <https://forum.ansible.com/t/failed-to-find-required-executable-mysql/18271>\
**Category:** Ansible Project\
**Created:** [May 20, 2015, 3:52pm UTC](https://forum.ansible.com/t/failed-to-find-required-executable-mysql/18271 "2015-05-20T15:52:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albert\_Mikaelyan](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Albert\_Mikaelyan](https://forum.ansible.com/u/Albert_Mikaelyan)\
**Post date:** [May 20, 2015, 3:52pm UTC](https://forum.ansible.com/t/failed-to-find-required-executable-mysql/18271/1 "2015-05-20T15:52:36Z")

</div>

Hey guys,

All I’m trying to do, is import a schema in case a database does not exist yet

ansible --version  
ansible 1.9.1

remote host is running centos 7 (fully updated) with mysql and mysql-python packages installed.

I have found only one person with this error, but in his case, the error was gone on second run, but for me it always fails.

`

### tasks/main.yml

- name: ensure databases exist  
mysql\_db:  
name: “{{ item.name }}”  
login\_host: “{{ item.login\_host }}”  
login\_user: “{{ item.login\_user }}”  
login\_password: “{{ item.login\_password }}”  
state: present  
register: current\_db  
notify: import schema  
with\_items:
- { name: “{{ first\_dbname }}”,  
login\_host: “{{ first\_dberver }}”,  
login\_user: “{{ root\_user }}”,  
login\_password: “{{ root\_pass }}” }
- { name: “{{ UNPUB\_DBName }}”,  
login\_host: “{{ second\_dbserver }}”,  
login\_user: “{{ root\_user }}”,  
login\_password: “{{ root\_pass }}” }
- { name: “{{ third\_dbname }}”,  
login\_host: “{{ third\_server }}”,  
login\_user: “{{ root\_user }}”,  
login\_password: “{{ root\_pass }}” }

`

`

### handlers/main.yml

- name: import schema  
mysql\_db:  
name: “{{ item.item.name }}”  
login\_host: “{{ item.item.login\_host }}”  
login\_user: “{{ item.item.login\_user }}”  
login\_password: “{{ item.item.login\_password }}”  
state: import  
target: “{{ temp\_path }}/install/db/mysql/schema.sql”  
with\_items: current\_db.results

`

Error received:

> NOTIFIED: install | import schema

> 

> failed: [host] =\> (item={‘invocation’: {‘module\_name’: u’mysql\_db’, ‘module\_args’: ‘’}, ‘item’: {‘login\_user’: u’root’, ‘login\_host’: u’host’, 'na

> me’: u’db\_name’, ‘login\_password’: u’pass’}, u’changed’: True, u’db’: u’db\_name’}) =\> {“failed”: true, “item”: {“changed”: true, “db”: “db\_name”, “invocatio  
> n”: {“module\_args”: “”, “module\_name”: “mysql\_db”}, “item”: {“login\_host”: “host”, “login\_password”: “pass”, “login\_user”: “root”, “name”: “db\_name”}}}  
> msg: Failed to find required executable mysql

- note: changed some names to not disclose my company things..

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [November 28, 2015, 11:41am UTC](https://forum.ansible.com/t/failed-to-find-required-executable-mysql/18271/2 "2015-11-28T11:41:56Z")

</div>

try to output the PATH var. looks like Ansible is using one that doesn’t have mysql in it.
