MySQL and MariaDB remain among the most-used databases in 2026, especially in legacy and e-commerce ecosystems. Connecting Apache Superset to MySQL takes a few minutes once the driver is installed. This tutorial details the procedure and best practices for 2026.
1. Prerequisites
- An accessible Superset instance (see hosting guide);
- A MySQL 5.7+ or MariaDB 10.3+ reachable from the instance;
- A read-only database account;
- The
mysqlclientorPyMySQLdriver installed.
If you want a ready-to-connect instance, TVL Managed Superset includes MySQL drivers by default.
2. Create a read-only account
CREATE USER 'superset_reader'@'%' IDENTIFIED BY 'XXX';
GRANT SELECT ON prod.* TO 'superset_reader'@'%';
FLUSH PRIVILEGES;
3. Build the URI
SQLAlchemy format for MySQL:
mysql+mysqlclient://<user>:<password>@<host>:<port>/<database>
With SSL:
mysql+mysqlclient://superset_reader:XXX@db.example.com:3306/prod?ssl_ca=/etc/ssl/certs/ca-certificates.crt
4. Add to Superset
- UI → Settings → Database Connections → + Database;
- Type: MySQL;
- Paste the URI;
- Test connection → Save.
5. Optimization
- Index columns filtered by dashboards;
- Read replica to offload the application primary;
- Connection pool in Superset:
pool_size: 10, pool_recycle: 3600; - Redis cache on Superset side (cf. Redis cache).
This configuration is applied by default on TVL Managed Superset, which follows community best practices.
6. MariaDB
MariaDB is a MySQL fork and compatible with the same driver. Use mysql+mysqlclient:// or mariadb+mariadbconnector:// as preferred.
7. Common pitfalls
- "Access denied": check that MySQL accepts remote connections (bind-address, GRANT '%');
- Unicode characters: force
charset=utf8mb4in URI; - Timezone: configure
time_zone = '+00:00'on MySQL side to avoid biases; - Driver compilation:
mysqlclientrequireslibmysqlclient-devon Linux.
8. Conclusion
Connecting MySQL to Apache Superset is fast and stable. For heavy loads or modern BI, consider migrating to Postgres or a columnar data warehouse (ClickHouse, BigQuery), but MySQL remains perfectly usable for most e-commerce and application cases.
Want the benefits of Apache Superset without the friction of installation and maintenance? Deploy your instance in 3 clicks with TVL Managed Superset, hosted in Europe (OVHcloud, Roubaix, France).
For more: connect PostgreSQL, connect Snowflake, connect ClickHouse.