title: MySQL, JSON, Python, Django - error totally whack
body: <p>I'm trying to populate JSON data fields in a MySQL database from python. I'm using MySQL 5.7.17 which supports the JSON datatype and Python 2.7.  I have defined 6 columns in my table as JSON. One of these fields gets populated from an Insert statement, successfully. I attempt to populate the remaining JSON fields using an UPDATE statement which fails:</p>
  
  <blockquote>
    <p>File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in defaulterrorhandler
      File "C:\Python27\lib\site-packages\MySQLdb\cursors.py", line 202, in execute
        raise errorclass, errorvalue
        self.errorhandler(self, exc, value)
    InterfaceError: (-1, 'error totally whack')
      File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in defaulterrorhandler
        raise errorclass, errorvalue
    InterfaceError: (-1, 'error totally whack')</p>
  </blockquote>
  
  <p>In all cases the data is defined as a dictionary in my python code which I then convert to a string like so:</p>
  
  <pre><code>my_dict = populate_dictionary() 
  my_dict_as_string = json.dumps(my_dict)
  </code></pre>
  
  <p>Has anyone else encountered this?  Perhaps a bug when updating MySQL? I don't have all my data available at the time of the insert otherwise I'd try an insert with all the JSON data.  I also prefer not to defer the insert until I have all the data.</p>
  
  <p>If I store the data as LONGBLOB instead everything works fine but then my Django front end can't read the data.  My Django data model defines all six of these fields as <code>models.BinaryField()</code></p>