title: how to store a huge string (length 50000) in mysql using python
body: <p>how to store a huge string (length 50000) in mysql using python.
  I have a big string of length nearly 50000 .I have to store it into mysql.
  Some suggested to store the string as a blob or text type.</p>
  
  <p>Can anyone help me how to convert string into blob type</p>
  
  <pre><code>def main():
      stringKey=''
      stringValues=''
      keys=ccv.keys()        //ccv is a dictionary data structure  
      vectors=ccv.values()  //ccv is a dictionary data structure 
      for key in keys:
              stringKey='#'.join(key for key in keys)
      for value in vectors:
              stringValues='$'.join(str(value) for value in vectors)
      insert(stringKey,stringValues)
      print 'insert successful'
  
  def insert(k,v):
      db = mysql.connector.connect(user='root', password='abhi',
                                host='localhost',
                                database='cbir')
  
      sql= 'INSERT INTO ccv(key,vector) VALUES(%s,%s)'
      args = (k,v)
      cursor=db.cursor()
      cursor.execute(sql,args)
      db.commit()
      db.close()
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>ProgrammingError: 1064 (42000): 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 'key,vector) VALUES('27:1:8#27:1:9#25:2:11#6:9:8#6:9:9#6:9:6#6:9:7#6:9:4#6:9:5#27' at line 1
  </code></pre>