目前使用環境:
server:ubuntu 16.04 + mysql 5.7 +phpmyadmin
在有固定ip的NAT 下,3306 PORT 有開
MYSQL的IP 限制也全部關閉了(所有IP 都可連)
另外有一片7688duo 負責收集感測器資料,用pymysql回傳資料
之前測試都是在區網下,資料都能正常丟進資料庫內
但是一把資料庫放到外網上,資料就丟不回去
max_allowed_packet 已經改成64M 了
程式碼:https://www.codepile.net/pile/kPY6lxz7
錯誤資訊:
Traceback (most recent call last):
File "sql-internet.py", line 11, in <module>
db="cultivator-test")
File "/usr/lib/python2.7/site-packages/pymysql/__init__.py", line 94, in
Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 325,
in __init__
self.connect()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 598,
in connect
self._get_server_information()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 975,
in _get_server_information
packet = self._read_packet()
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 657,
in _read_packet
packet_header = self._read_bytes(4)
File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 699,
in _read_bytes
"Lost connection to MySQL server during query (%s)" % (e,))
pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during
query ([Errno 131] Connection reset by peer)')
另外想請教用google chart,如果想要圖表可以自動更新(不要刷新網頁)
一定要用到jquery之類的功能嗎,或是有其他可以單純的js就能解決?