Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

mysql.connector error reading LONGBLOB (no replies)

$
0
0
myTable has three columns:
('timeStamp', 'datetime')
('modelName', 'varchar(20)')
('model', 'longblob')

When I try to SELECT from myTable, a TypeError occurs. Not sure why.

............
Error
............


TypeError: sequence item 0: expected string, bytearray found

............
Query
............

import mysql.connector
conn = mysql.connector.connect(user='user'
, password='<removed>'
, host='localhost'
, port=3364
, database='database'
, charset='utf8')

cur = conn.cursor()
cur.execute("""SELECT * FROM myTable;""")
print type(cur)
rows = cur.fetchall()

Viewing all articles
Browse latest Browse all 384

Trending Articles