# mysql\_db - importing .sql

**URL:** <https://forum.ansible.com/t/mysql-db-importing-sql/13228>\
**Category:** Ansible Project\
**Created:** [July 31, 2013, 8:49am UTC](https://forum.ansible.com/t/mysql-db-importing-sql/13228 "2013-07-31T08:49:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iliya\_Strakovich](https://avatars.discourse-cdn.com/v4/letter/i/91b2a8/32.png) [@Iliya\_Strakovich](https://forum.ansible.com/u/Iliya_Strakovich)\
**Post date:** [July 31, 2013, 8:49am UTC](https://forum.ansible.com/t/mysql-db-importing-sql/13228/1 "2013-07-31T08:49:46Z")

</div>

Hi,

I need your help.

I’m trying to restore database from sql with mysql\_db module (python-mysqldb: 1.2.3-1ubuntu0.1)  
Previously I removed all files in /var/lib/mysql/\*  
and recreate database with mysql\_install\_db  
so now I can “mysql -u root” w/o password

**TASK: [mysql\_user name=root host=localhost password=123123 priv=_._:ALL state=present] \*\*\***  
fatal: [192.168.10.221] =\> failed to parse: Traceback (most recent call last):  
File “/home/iliya/.ansible/tmp/ansible-1375259963.04-183140106975975/mysql\_user”, line 1281, in   
main()  
File “/home/iliya/.ansible/tmp/ansible-1375259963.04-183140106975975/mysql\_user”, line 374, in main  
changed = user\_mod(cursor, user, host, password, priv)  
File “/home/iliya/.ansible/tmp/ansible-1375259963.04-183140106975975/mysql\_user”, line 156, in user\_mod  
privileges\_revoke(cursor, user,host,db\_table)  
File “/home/iliya/.ansible/tmp/ansible-1375259963.04-183140106975975/mysql\_user”, line 237, in privileges\_revoke  
cursor.execute(query)  
File “/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py”, line 174, in execute  
self.errorhandler(self, exc, value)  
File “/usr/lib/python2.7/dist-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler  
raise errorclass, errorvalue  
\_mysql\_exceptions.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’‘@’’ FROM ‘root’@‘localhost’’ at line 1”)

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [July 31, 2013, 6:42pm UTC](https://forum.ansible.com/t/mysql-db-importing-sql/13228/2 "2013-07-31T18:42:09Z")

</div>

Can you let me know what version of Ansible this is from?

Thanks!
