title: How to store python dictionary in to mysql DB through python
body: <p>I am trying to store the the following dictionary into mysql DB by converting the dictionary into a string and then trying to insert, but I am getting following error. How can this be solved, or is there any other way to store a dictionary into mysql DB?</p>
  
  <pre><code>dic = {'office': {'component_office': ['Word2010SP0', 'PowerPoint2010SP0']}}
  d = str(dic)
  
  # Sql query
  sql = "INSERT INTO ep_soft(ip_address, soft_data) VALUES ('%s', '%s')" % ("192.xxx.xx.xx", d )
  
  soft_data is a VARCHAR(500)
  </code></pre>
  
  <p>Error:
      execution exception (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 'office': {'component_office': ['Word2010SP0', 'PowerPoint2010SP0' at line 1")</p>
  
  <p>Any suggestions or help please?</p>