1. Images & Charts
  2. mysql
mysql

mysql

Data
Updated 17 hours ago

MySQL Overview

Secure your stack with a hardened MySQL image freshly-built by Minimus. Minimus images always include the most up-to-date package version for all packages and dependencies contained in the image.


Try It Out

Take the Minimus MySQL image for a test run. The following command will set the root password to Minimus! but you can set any password you want:

docker run --name minimus-mysql \
    -e MYSQL_ROOT_PASSWORD=Minimus! -d \
    reg.mini.dev/mysql

Start a shell in your container:

docker exec -it minimus-mysql sh

Then log into the database:

mysql -u root -p

Submit the password you set when you ran the container. (In our example, it's Minimus!.) Once logged in, you should see MySQL status messages such as:

> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 9
> Server version: 9.3.0 Source distribution
> 
> Copyright (c) 2000, 2025, Oracle and/or its affiliates.
> 
> Oracle is a registered trademark of Oracle Corporation and/or its
> affiliates. Other names may be trademarks of their respective
> owners.
> 
> Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Ready to interact with your MySQL server?

You should see the mysql> prompt of the MySQL shell. For our example, we will pass a command to list all databases:

show databases;

Note that the semicolon ; marks the end of the command. If you drop it, you will see a continuation prompt (->) to add more input.

MySQL will print database metadata. For example:

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

Run MySQL with Docker Compose

You can use a compose.yaml file to configure the MySQL database and set the appropriate environment variables.

The following variables are commonly used:

  • MYSQL_USER and MYSQL_PASSWORD - Create a new user and set its password
  • MYSQL_ALLOW_EMPTY_PASSWORD - Start the container without a root user password
  • MYSQL_DATABASE - Create a new empty database
  • MYSQL_ROOT_PASSWORD_FILE - instead of passing sensitive info in the command line you can provide a path to password file

Technical Considerations

The MySQL image provided by Minimus is a slim, security-hardened alternative to the public image from Docker Hub. The images are largely interchangeable, with a few differences as noted below.

MySQL built by Minimus:

  1. Runs as non-root by default for a security-first approach that protects against privilege escalation attacks. The public image runs as root.
  2. Listens on but does not expose the default ports: 3306/tcp and 33060/tcp. The public image listens on and exposes those ports by default.
  3. The image does not have a default volume. The public image defaults to /var/lib/mysql.
  4. Drill down on the version specification tab to see the default user, listening ports, entrypoint, volumes, environment variables, etc.

The Payoff

A hardened, minimal image that will remain more secure for the long run and accrue vulnerabilities at a slower rate.


Terms & Info

Trademark

This catalog is published by Minimus. All product names, logos, and marks, other than those belonging to Minimus, shown are owned by their respective rights holders and appear here only to identify the open source software each image contains. Minimus claims no ownership of those marks and implies no affiliation with, endorsement by, certification by, or sponsorship by any rights holder.

Disclaimer

Images are provided "as-is" without warranty of any kind. "Hardened" refers to the security configuration applied at the time of build and does not constitute a guarantee of ongoing security or absence of vulnerabilities. The free tier is provided without support, SLA, or guaranteed patching timelines. Security updates may be applied to paid subscriptions before or instead of free tier images. By pulling or using any image you agree to our Terms of Use.