title: How do I get a literal '%' in a mysql connector python query?
body: <p>Consider this code:</p>
  <pre class="lang-py prettyprint-override"><code>def search(searchstr: str, limit: int=10, offset: int=0):
      csr = app.sql.cursor(dictionary=True)
      csr.execute(&quot;select username, fname, bio from followers where username like %%%s%% limit %d offset %d&quot;, (searchstr, limit, offset))
      return csr.fetchall()
  
  search(&quot;j&quot;)
  </code></pre>
  <p>where <code>app.sql</code> is a reference to the connection object.</p>
  <p>I would like it to execute something similiar to:
  <code>select username, fname, bio from followers where username like %j% limit 10 offset 0</code>
  but instead it always gives me the error:</p>
  <pre><code>  File &quot;/---/user.py&quot;, line 67, in search
      csr.execute(&quot;select username, fname, avatarUrl, bio from followers where username like %%%s%% limit %d offset %d&quot;, (searchstr, limit, offset))
    File &quot;/---/venv/lib/python3.8/site-packages/mysql/connector/cursor.py&quot;, line 542, in execute
      raise errors.ProgrammingError(
  mysql.connector.errors.ProgrammingError: Not all parameters were used in the SQL statement
  </code></pre>
  <p>I can't figure out what I am doing wrong because</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; &quot;%%%s%% %d %d&quot; % (&quot;j&quot;, 10, 0)
  &quot;%j% 10 0&quot;
  </code></pre>
  <p>which is the expected output. How can I fix this?</p>