Python 2.7 Python MySQLdb:创建表的困难
使用python在mysqldb中创建表时,我遇到了如下问题:Python 2.7 Python MySQLdb:创建表的困难,python-2.7,mysql-python,Python 2.7,Mysql Python,使用python在mysqldb中创建表时,我遇到了如下问题: cursor.execute("CREATE TABLE IF NOT EXISTS %s ( tweetId VARCHAR(100) NOT NULL, tweet VARCHAR(180) NOT NULL, PRIMARY KEY(tweetId) )",('Tutulive')) . 我得到这个错误: _mysql_exceptions.ProgrammingError: (1064, "You have an erro
cursor.execute("CREATE TABLE IF NOT EXISTS %s ( tweetId VARCHAR(100) NOT NULL, tweet VARCHAR(180) NOT NULL, PRIMARY KEY(tweetId) )",('Tutulive')) .
我得到这个错误:
_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 ''Tutulive' ( tweetId VARCHAR(100) NOT NULL, tweet VARCHAR(180) NOT NULL, PRIMARY' at line 1")
SQL参数不应用于元数据。自行清理该值并将其正常插入字符串。清理是什么意思?