I'm trying to update an empty mySQL database using Python.
This is the error I receive:
pymysql.err.InternalError: (1416, 'Cannot get geometry object from data you send to the GEOMETRY field')
Here's the problematic code:
try:
with connection.cursor() as cursor:
# Create a new record
sql = "INSERT INTO `projects` (`name`, `country`, `activation_date`, `active`) VALUES (%s, %s, %s, %s)"
cursor.execute(sql, ('Nate', 'USA', '2016-06-23 09:11:32', '1'))
connection.commit()
finally:
connection.close()
Here is what the table looks like in the database (it's empty):


LineStringthe wrong way and meant to use a varchar or text type. A LineString consists of Points and is meant for spatial data, not text.