Error when creating table with mysqldb module
I'm trying to create a table with 2 columns using python's mysqldb module,
but I get an error, what might be wrong here?
cur.execute("CREATE TABLE foreign_crew(id VARCHAR() PRIMARY_KEY, surname
VARCHAR(45))")
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Python27\lib\site-packages\MySQLdb\cursors.py", line 202, in
execute
self.errorhandler(self, exc, value)
File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in
defaulterrorhandler
raise errorclass, errorvalue
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 ') PRIMARY_KEY, surname VARCHAR(45))' at line 1")
No comments:
Post a Comment