Has something changed with the mysql databases? The following script, WAS working, but now isn't?
import MySQLdb
db = MySQLdb.connect("xx.mysql.pythonanywhere-services.com","xx", "xx", "xx$xx")
cursor = db.cursor()
cursor.execute("DROP TABLE IF EXISTS group")
# Create table as per requirement
sql = """CREATE TABLE group (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
profile_id int,
keyword VARCHAR(512),
landing_page VARCHAR(512),
PRIMARY KEY (id))"""
cursor.execute(sql)
db.commit()
db.close()
error
12:10 ~/ontail/db_scripts$ python group.py
Traceback (most recent call last):
File "group.py", line 8, in <module>
cursor.execute("DROP TABLE IF EXISTS group")
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server versi
on for the right syntax to use near 'group' at line 1")