I'm working in Python and using the MySQLdb module. I have a working connection (I can run other queries successfully)
c.execute("ALTER TABLE results ADD COLUMN desc TEXT")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/MySQLdb/cursors.py", line 166, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/pymodules/python2.7/MySQLdb/connections.py", line 35,
in defaulterrorhandler
raise errorclass, errorvalue
I'm getting the following error:
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near 'desc TEXT' at line 1")
I've had similar trouble before; MySQLdb's syntax error messages are terribly non-descriptive.
How can this be fixed?