Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 Python MySQLdb:创建表的困难_Python 2.7_Mysql Python - Fatal编程技术网

Python 2.7 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

使用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 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参数不应用于元数据。自行清理该值并将其正常插入字符串。

清理是什么意思?