title: How can I retrieve binary data using Mysql Python connector?
body: <p>If I create a simple table in MySQL with binary data:</p>
  
  <pre><code>CREATE TABLE foo ( bar binary(4) )
  INSERT INTO foo (bar) VALUES ( UNHEX('de12') )
  </code></pre>
  
  <p>Then try to read it using the MySQL Connector/Python:</p>
  
  <pre><code>import mysql.connector
  conn = mysql.connector.connect(database='test', user='test')
  cursor = conn.cursor()
  cursor.execute("SELECT * FROM foo")
  cursor.fetchall()
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>UnicodeDecodeError: 'utf8' codec can't decode byte 0xde in position 0: invalid continuation byte
  </code></pre>
  
  <p>I don't understand why the Python MySQL connector is trying to decode the column as UTF-8. I just want to get the raw binary data, how can I do this?</p>
  
  <p>(Python 2.7.10, Mysql 5.7.22, MySQL Connector/Python 8.0.12)</p>