Bug description

  1. Env: Python 3.11.13 by conda sys: Ubuntu 22.04 user: root
  2. Build flow(https://superset.apache.org/docs/installation/pypi):
  3. sudo apt-get install build-essential libssl-dev libffi-dev python3-dev python3-pip libsasl2-dev libldap2-dev default-libmysqlclient-dev
  4. pip install apache_superset
  5. export SUPERSET_SECRET_KEY=< ... > .
  6. export FLASK_APP=superset
  7. superset db upgrade
  8. superset fab create-admin
  9. superset load_examples
  10. superset init
  11. superset run -p 8088 --with-threads --reload --debugger Additional:
  12. pip install mysqlclient mysql-connector-python
  13. BUG: When selecting Connect to a Database, neither the optional database icon nor the drop-down box includes MySQL. Connecting via mysql://:@/ shows connection failure
  14. Solution:
    '''bash export LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6 '''

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.11

Node version

16

Browser

Chrome

Additional context

No response

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 @2308087369! I'm Dosu and I’m helping the superset team.

MySQL is missing from the connection options because, starting with Superset 4.1.0, database drivers like mysqlclient are no longer bundled by default—you have to install them yourself for MySQL support to appear in the UI. Even though you ran pip install mysqlclient, in some environments (especially with conda or when running as root), the package may not be visible to the Python interpreter that runs Superset, or system dependencies may be missing or mismatched. This is the most common cause of the missing MySQL icon and dropdown option [1] [2].

Here’s what to check:

  1. Make sure all required system dependencies are installed:
    sudo apt-get install build-essential python3-dev default-libmysqlclient-dev pkg-config
  2. Reinstall mysqlclient in the exact Python environment where Superset runs (activate your conda env if using one):
    pip install --force-reinstall --no-cache-dir mysqlclient
  3. Restart Superset after installation.
  4. If MySQL still doesn’t appear, check the Superset logs for errors like No module named 'MySQLdb'. This indicates mysqlclient is still not accessible to Superset [3].

Note: Installing only mysql-connector-python is not enough—Superset expects the MySQLdb dialect provided by mysqlclient for full MySQL support. Using mysql-connector-python can cause compatibility issues and is not the default or recommended driver [4].

The LD_PRELOAD workaround is not a standard or documented fix for this issue and is unlikely to help unless you have a very specific library loading problem, which is rare in this context.

If you still don’t see MySQL after these steps, double-check that you’re running Superset in the same environment where you installed mysqlclient, and share any relevant error logs for further troubleshooting.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: 2308087369

Thanks @dosu, I mentioned in my description that I pip installed two related dependencies for mysql, but it didn't work. The next step is to set the environment variables LD_PRELOAD make the mysql connection normal