Bug description
Accessing a mysql db with MysqlConnector, we received mysql error: No result set to fetch from
when we try to do an insert, create, update.
The same statement work with the mysqldb python module, but we need the caching_sha2_password option, i can not use it anymore in real life.
Screenshots/recordings
Superset version
4.1.2
Python version
3.11
Node version
I don't know
Browser
Chrome
Additional context
superset_app | 2025-07-17 15:35:10,963:DEBUG:superset.sql_parse:Parsing with sqlparse statement: INSERT INTO yves_tst values ( 5 )
superset_app | 2025-07-17 15:35:10,970:DEBUG:root:Query 34414: Running query: INSERT INTO yves_tst values ( 5 )
superset_app | 2025-07-17 15:35:10,971:DEBUG:superset.sql_parse:Parsing with sqlparse statement: INSERT INTO yves_tst values ( 5 )
superset_app | 2025-07-17 15:35:10,973:DEBUG:root:Query 34414: Handling cursor
superset_app | 2025-07-17 15:35:10,973:DEBUG:superset.stats_logger:[stats_logger] (timing) sqllab.query.time_executing_query | 5.1240234375
superset_app | 2025-07-17 15:35:10,974:DEBUG:superset.sql_lab:Query 34414: Fetching data for query object: {'changed_on': '2025-07-17T15:35:10.965779', 'dbId': 65, 'db': 'MySQL', 'endDttm': None, 'errorMessage': None, 'executedSql': 'INSERT INTO yves_tst values ( 5 )', 'id': 'WxvM8Ntcx5A', 'queryId': 34414, 'limit': 1000, 'limitingFactor':
Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hi @ydastous! I'm Dosu and I’m helping the superset team.
This error is due to a compatibility mismatch between Superset's result-fetching logic and how the mysql-connector-python driver signals result set availability for DDL/DML statements like INSERT, CREATE, or UPDATE. Superset expects the driver to properly indicate when a statement does not return a result set, but mysql-connector-python sometimes does not, leading to the "No result set to fetch from" error. Other drivers, like mysqldb, handle this signaling differently, which is why you don't see the error there. This is a known class of compatibility issues with mysql-connector-python in Superset, but there is no documented workaround or configuration to resolve it as of 4.1.2 reference reference.
If you require caching_sha2_password and cannot use mysqldb, you may need to monitor for upstream fixes or consider alternative approaches, as Superset's MySQL engine spec does not currently have special handling for this error with mysql-connector-python.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: ydastous
Hello @dosu is there a list of other drivers i can try with mysql ?
Yves
On Thu, Jul 17, 2025 at 11:42 AM dosubot[bot] @.***> wrote:
dosubot[bot] left a comment (apache/superset#34208) https://github.com/apache/superset/issues/34208#issuecomment-3084551213
Hi @ydastous https://github.com/ydastous! I'm Dosu https://go.dosu.dev/dosubot and I’m helping the superset team.
This error is due to a compatibility mismatch between Superset's result-fetching logic and how the mysql-connector-python driver signals result set availability for DDL/DML statements like INSERT, CREATE, or UPDATE. Superset expects the driver to properly indicate when a statement does not return a result set, but mysql-connector-python sometimes does not, leading to the "No result set to fetch from" error. Other drivers, like mysqldb, handle this signaling differently, which is why you don't see the error there. This is a known class of compatibility issues with mysql-connector-python in Superset, but there is no documented workaround or configuration to resolve it as of 4.1.2 reference https://github.com/apache/superset/issues/33855 reference https://github.com/apache/superset/issues/33157.
If you require caching_sha2_password and cannot use mysqldb, you may need to monitor for upstream fixes or consider alternative approaches, as Superset's MySQL engine spec does not currently have special handling for this error with mysql-connector-python.
To reply, just mention @dosu https://go.dosu.dev/dosubot.
How did I do? Good https://app.dosu.dev/response-feedback/5c75e684-e2c9-41c2-aa13-f125ba0940ee?feedback_type=great_response | Irrelevant https://app.dosu.dev/response-feedback/5c75e684-e2c9-41c2-aa13-f125ba0940ee?feedback_type=irrelevant_answer | Incorrect https://app.dosu.dev/response-feedback/5c75e684-e2c9-41c2-aa13-f125ba0940ee?feedback_type=incorrect_sources | Verbose https://app.dosu.dev/response-feedback/5c75e684-e2c9-41c2-aa13-f125ba0940ee?feedback_type=too_verbose | Hallucination https://app.dosu.dev/response-feedback/5c75e684-e2c9-41c2-aa13-f125ba0940ee?feedback_type=hallucination | Report 🐛 https://app.dosu.dev/response-feedback/5c75e684-e2c9-41c2-aa13-f125ba0940ee?feedback_type=bug_report | Other https://app.dosu.dev/response-feedback/5c75e684-e2c9-41c2-aa13-f125ba0940ee?feedback_type=other [image: Join Discord] https://go.dosu.dev/discord-bot [image: Share on X] https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34208
— Reply to this email directly, view it on GitHub https://github.com/apache/superset/issues/34208#issuecomment-3084551213, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADFBC5ZIABGW7PIPFQIHDID3I677JAVCNFSM6AAAAACBYGX73WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAOBUGU2TCMRRGM . You are receiving this because you were mentioned.Message ID: @.***>
Comment From: dosubot[bot]
Superset officially supports two MySQL drivers: mysqlclient (the default, also known as mysqldb) and mysql-connector-python. mysqlclient is recommended for most cases, but it does not support the caching_sha2_password authentication plugin used by newer MySQL servers. If you need caching_sha2_password, you should use mysql-connector-python instead. Both drivers are supported for basic SQL operations, but as you've seen, there are known issues with DDL/DML result set handling in mysql-connector-python docs.
PyMySQL is mentioned in some community discussions as a possible alternative (connection string: mysql+pymysql://user:password@host:port/dbname
), but it is not officially documented or supported by Superset, and its compatibility—especially with authentication plugins and DDL/DML handling—may be limited discussion.
No other MySQL drivers are officially recognized or documented as supported by Superset for MySQL connections. If you need caching_sha2_password, mysql-connector-python is the main supported option, despite its current limitations with DDL/DML in Superset docs.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: ydastous
At this point i will close this ticket since no solution is working for me, The superset doc about de database driver should be update to reflect the fact about known issues with DDL/DML result set handling in mysql-connector-python.