之前好好的,重新安装了数据库,然后就报错了,望帮忙看看呢。谢谢
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Users/kelvintong/Documents/pycode/demo1/wiki2mysql.py
Wikipedia <----> https://en.wikipedia.org/wiki/Wikipedia
Traceback (most recent call last):
File "/Users/kelvintong/Documents/pycode/demo1/wiki2mysql.py", line 35, in <module>
cursor.execute(sql,(url.get_text(),"https://en.wikipedia.org"+ url["href"]))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymysql/cursors.py", line 166, in execute
result = self._query(query)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymysql/cursors.py", line 322, in _query
conn.query(q)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymysql/connections.py", line 852, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymysql/connections.py", line 1053, in _read_query_result
result.read()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymysql/connections.py", line 1336, in read
first_packet = self.connection._read_packet()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymysql/connections.py", line 1010, in _read_packet
packet.check_error()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymysql/connections.py", line 393, in check_error
err.raise_mysql_exception(self._data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1364, "Field 'id' doesn't have a default value")
Process finished with exit code 1