显示mysql连接器的异常是告诉您该表在您的数据库中不存在。
另外,您尝试使用“ MachinePorn”作为参数,但未在查询中定义它,而是将其硬编码为“ subredditName”。
我认为您应该在查询中将数据库定义为另一个参数,它将正常运行:
def dataEntry(subreddit, _title, _post_url, _imageURL): cnx = mysql.connector.connect(**config) c = cnx.cursor() insert = cnx.escape_string("INSERT INTO MachinePorn (subreddit, title, post_url, imageURL) VALUES (%s, %s, %s, %s)") data_value = (subreddit, _title, _post_url, _imageURL) c.execute(insert, data_value) cnx.commit() c.close() cnx.close()dataEntry("fake", "fake", "fake", "fake")


