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')
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'))
It looks like you're using the MySQL type
linestring to represent a string, while in MySQL the correct type to represent a string of characters would be
linestring is a representation of a geometric line, as you can see here: https://dev.mysql.com/doc/refman/5.7/en/gis-linestring-property-functions.html
To fix this, simply change the column types of
text. See: http://dev.mysql.com/doc/refman/5.7/en/char.html