GitHub user Ikarashi0310 closed a discussion: Could not load database driver:
MySQLEngineSpec
I'm encountering an issue when trying to connect to a MySQL database from a
custom Superset Docker image built using the **latest** tag.
The error message I receive is:
**`Could not load database driver: MySQLEngineSpec`**
### Context
1. **Working Scenario (Master Tag):** When I used a custom image based on the
**`master`** Docker image tag (from a while ago), the MySQL connection worked
perfectly without any additional driver installation steps in my custom
Dockerfile.
2. **Failing Scenario (Latest Tag):** After switching my base image to the
**`latest`** tag, I started seeing this driver loading error.
3. **My Setup:**
* I'm using a **custom Dockerfile** based on the official Apache Superset
image (`apache/superset:latest`).
* The MySQL instance is running on a separate container (via Docker
Compose).
### My Question
It seems the necessary Python database driver (like `mysqlclient` or `PyMySQL`)
might no longer be pre-installed in the `latest` image by default, whereas it
was likely included in the older `master` image.
Could someone confirm if this is the case?
If so, what is the **recommended method** to reliably install the MySQL driver
(`mysqlclient` or other) into the current **`latest`** Superset Docker image
for a production-like environment?
I'd appreciate any guidance or pointers to the relevant documentation or a
best-practice Dockerfile snippet.
Thank you in advance for your help!
```
FROM apache/superset:latest
USER root
RUN apt-get update && apt-get install -y \
pkg-config \
default-libmysqlclient-dev \
gcc \
libssl-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
USER superset
RUN pip install mysqlclient pymysql psycopg2
CMD ["superset", "run", "-h", "0.0.0.0", "-p", "8088", "--with-threads",
"--reload"]
```
GitHub link: https://github.com/apache/superset/discussions/35175
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]