在superset里加载数据后,点击【Run Query】,会出现运行错误,如下
复制到notepad++里分析
<html> <body> <h1>Sorry, something went wrong</h1> <h3>500 - Internal Server Error</h3> <hr> <h2>Stacktrace</h2> <hr> <code> <pre> Traceback (most recent call last):
File "D:\soft\anaconda\envs\superset\lib\site-packages\sqlalchemy\engine\base.py", line 1193, in _execute_context context)
File "D:\soft\anaconda\envs\superset\lib\site-packages\sqlalchemy\engine\default.py", line 507, in do_execute cursor.execute(statement, parameters)
File "D:\soft\anaconda\envs\superset\lib\site-packages\pymysql\cursors.py", line 148, in execute result = self._query(query)
File "D:\soft\anaconda\envs\superset\lib\site-packages\pymysql\cursors.py", line 310, in _query conn.query(q)
File "D:\soft\anaconda\envs\superset\lib\site-packages\pymysql\connections.py", line 548, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "D:\soft\anaconda\envs\superset\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result result.read()
File "D:\soft\anaconda\envs\superset\lib\site-packages\pymysql\connections.py", line 1156, in read first_packet = self.connection._read_packet()
File "D:\soft\anaconda\envs\superset\lib\site-packages\pymysql\connections.py", line 725, in _read_packet packet.raise_for_error()
File "D:\soft\anaconda\envs\superset\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data)
File "D:\soft\anaconda\envs\superset\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.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 'rows, error_message, results_key, start_time, start_running_time, end_time, end_' at line 1")
The above exception was the direct cause of the following exception:
....
在网上反复寻找,在经过自己分析,应该是pymysql的版本无法和mysql适应,后发现mysql太高(我的是8.0版本),可以使用5.6或5.7版本。
卸载MySQL8.0,重新安装MySQL 5.6,重新安装mysql-workbench-community-8.0.23-winx64.msi,重新安装superset后,加载数据后,成功显示数据。