# ansible command throwing error while running mysql query with where clause

**URL:** <https://forum.ansible.com/t/ansible-command-throwing-error-while-running-mysql-query-with-where-clause/24198>\
**Category:** Ansible Project\
**Created:** [April 12, 2017, 9:59am UTC](https://forum.ansible.com/t/ansible-command-throwing-error-while-running-mysql-query-with-where-clause/24198 "2017-04-12T09:59:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anaparthi\_naresh\_bab](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@anaparthi\_naresh\_bab](https://forum.ansible.com/u/anaparthi_naresh_bab)\
**Post date:** [April 12, 2017, 9:59am UTC](https://forum.ansible.com/t/ansible-command-throwing-error-while-running-mysql-query-with-where-clause/24198/1 "2017-04-12T09:59:41Z")

</div>

Tried running below query and throwing error. Looks issue with single/double quotes. Do we need to use any escape sequence like /"

ansible EM7DBVIPTEST -m shell -a ‘silo\_mysql -e “update master.system\_settings\_backup set backup\_start\_time = “2011-01-01 05:00:00” where id=1”’ -c paramiko  
Customer0 | FAILED | rc=1 \>\>  
ERROR 1049 (42000): Unknown database ‘05:00:00 where id=1’

Thanks,  
Naresh

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [April 13, 2017, 8:33am UTC](https://forum.ansible.com/t/ansible-command-throwing-error-while-running-mysql-query-with-where-clause/24198/2 "2017-04-13T08:33:01Z")

</div>

> Tried running below query and throwing error. Looks issue with  
> single/double quotes. Do we need to use any escape sequence like /"

Escape is backslash \ not slash /.

> ansible EM7DBVIPTEST -m shell -a 'silo\_mysql -e "update  
> master.system\_settings\_backup set backup\_start\_time = "2011-01-01 05:00:00"  
> where id=1"' -c paramiko  
> Customer0 | FAILED | rc=1 \>\>  
> ERROR 1049 (42000): Unknown database '05:00:00 where id=1'

Are you trying to run this command?  
silo\_mysql -e "update master.system\_settings\_backup set backup\_start\_time = "2011-01-01 05:00:00" where id=1"

If so you'll need to escape the double quotes around the date.
