PyMySQL variable using GRANT ALL PRIVILEGES in one database
<p>I'm looking to automate creating a database and user from user input with the pymysql module. </p>

<p>I'm looking to grant all privileges to the newly created user in one database:</p>

<pre><code>cur.execute("GRANT ALL PRIVILEGES ON %s.* to %s@%s IDENTIFIED BY %s", (DB_NAME,DB_USER, DB_HOST, DB_PASS))
</code></pre>

<p>I get the below error. </p>

<pre><code>pymysql.err.ProgrammingError: (1064, u"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''test26'.* to 'test26'@'localhost' IDENTIFIED BY 'test26'' at line 1")
</code></pre>