title: Updating Mysql JSON field
body: <p>I'm using django 1.8.9 and MySQL 5.7.17. I've a following table:</p>
  
  <pre><code>+----------+--------------+------+-----+---------+----------------+
  | Field    | Type         | Null | Key | Default | Extra          |
  +----------+--------------+------+-----+---------+----------------+
  | brand    | varchar(255) | YES  | MUL | NULL    |                |
  | new_info | json         | YES  |     | NULL    |                |
  | keywords | json         | YES  |     | NULL    |                |
  | notes    | varchar(255) | YES  |     | NULL    |                |
  | id       | mediumint(9) | NO   | MUL | NULL    | auto_increment |
  +----------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>In django I have this model (<a href="http://django-mysql.readthedocs.io/en/latest/model_fields/json_field.html" rel="nofollow noreferrer"><code>JSONField</code></a> is from django_mysql):</p>
  
  <pre><code>class info_by_kw(Model):
      brand = ForeignKey(Brand, on_delete=CASCADE, db_column='brand')
      # new_info = JSONField(blank=True, null=True)
      keywords = JSONField(blank=True, null=True)
      notes = CharField(max_length=255, blank=True, null=True)
  </code></pre>
  
  <p>When the data is saved I get a very meaningful error: (-1, 'error totally whack'). Anyway, it ends up in the following SQL statement:</p>
  
  <pre><code>UPDATE `products_info_by_kw` SET `brand` = _binary'BINGO!', `keywords` = _binary'[[\\"Tomato\\", \\"Madness\\"]]', `notes` = _binary'' WHERE `products_info_by_kw`.`id` = 48;
  </code></pre>
  
  <p>With the more or less expected result:</p>
  
  <pre><code>ERROR 3144 (22032): Cannot create a JSON value from a string with CHARACTER SET 'binary'.
  </code></pre>
  
  <p>Brief search gave this result: <a href="https://code.djangoproject.com/ticket/26140" rel="nofollow noreferrer">https://code.djangoproject.com/ticket/26140</a>, so maybe it's a right thing to do and my mysql (or django) is misconfigured. Does anyone have an idea of how to fix it?</p>