Docker app installer

install_mysql57_base_docker.sh

A helper.sh-hosted script that creates the /data/mysql5.7 layout, writes a baseline MySQL 5.7 config, pulls mysql:5.7.44, and runs a restartable container with mounted data, config, and init directories.

One-liner

curl -fL 'https://www.helper.sh/install_mysql57_base_docker.sh' -o './install_mysql57_base_docker.sh'

This command downloads the bundled file only; it does not run it. Inspect the saved source and compare its version before deciding whether to execute it.

Check the file you downloaded

Compare a saved file with the exact bytes bundled in this page’s build. The file stays in this tab; this tool does not upload or persist it. Maximum 2 MiB.

Expected SHA-256
6d16610c307e30338e693a6cfdbf6d86ffa85e6260b7407346ae3ca1bddf9ef3

Bundled byte count: 6038

Save checksum file

Save the script and checksum in the same directory. On Linux with GNU Coreutils, the command below checks the saved bytes only; it does not run the script. Keep the original filename for this command.

sha256sum --check './install_mysql57_base_docker.sh.sha256'

No comparison yet.

The checksum and script come from the same site, not an independent signature. A match does not prove safety, authenticity of upstream dependencies, or suitability for your host. Mutable remote dependencies need separate review.

Read validation and limitations

Requirements

  • Linux host
  • Docker installed and running
  • root privileges or sudo
  • Port 3306 available
  • /data writable on the host

Best for

  • Bring up a MySQL 5.7 instance quickly on a Docker-ready host
  • Keep MySQL data, config, and init SQL scripts under /data/mysql5.7 on the host
  • Standardize a reviewed bootstrap path for legacy applications that still depend on MySQL 5.7

Highlights

  • Creates /data/mysql5.7/data, conf.d, and init automatically
  • Pulls mysql:5.7.44 and starts a restartable MySQL 5.7 container
  • Generates a strong root password automatically if you do not provide one
  • Supports optional initial database, user, and password creation on first boot

Recommended procedure

  1. Confirm Docker is already installed and the host can expose port 3306.
  2. Run the helper.sh command with sudo or as root.
  3. Let the script prepare /data/mysql5.7, pull mysql:5.7.44, and create the container.
  4. Record the printed root password and optional user credentials before handing the database to an application team.

Safety notes

  • Do not expose MySQL 5.7 directly to the public internet without network controls.
  • Record the generated root password immediately if you did not provide one.
  • Back up /data/mysql5.7 before replacing or recreating a production container.

Compatibility and limits

  • Linux with systemd, Docker, root access, and free host port 3306 by default. The image is fixed at mysql:5.7.44; treat it as a legacy compatibility example.
  • Supported options are --data-dir, --container-name, --port, --root-password, --database, --user, and --password. It also reads MYSQL_ROOT_PASSWORD, MYSQL_DATABASE, MYSQL_USER, and MYSQL_PASSWORD from the environment. There is no dry-run or backup.
  • The script publishes the selected host port and Docker firewall behavior may bypass some host firewall rules. Do not expose MySQL publicly without reviewed network controls. Passwords are passed as Docker environment arguments, remain inspectable in container configuration, and are printed by the script; avoid shell history and shared logs.

Files, services, and data affected

  • /data/mysql5.7/data, conf.d, and init are created. mysql57.cnf is written only if absent; existing data/config are reused.
  • Starts Docker if inactive, pulls mysql:5.7.44, force-removes an existing container with the selected name, then creates a restartable container with host mounts and a published port.
  • Removing the old container does not remove the host bind-mounted data directory. The script does not back it up before reuse.

Read-only verification

  • These examples use the default container name mysql57; substitute your --container-name value if changed. Check `docker ps --filter name=mysql57` and `docker logs --tail 100 mysql57`.
  • Check published ports and mounts with `docker inspect mysql57 --format '{{json .HostConfig.PortBindings}} {{json .Mounts}}'`.
  • Run `docker exec -it mysql57 mysqladmin ping -h 127.0.0.1 -uroot -p` and `docker exec -it mysql57 mysql -uroot -p -e 'SELECT VERSION();'`; enter the password at the prompt.

If it fails

If readiness fails, inspect container logs, available disk space, the selected data directory, and credentials. Preserve the host data before any retry; the final “completed” message can appear even when the health check only reports a warning.

Download, inspect, then verify the version before execution. A hash only identifies these exact bytes; it does not prove safety. Piped commands run remote content immediately, and upstream dependencies can change.

Related topics

Ubuntu: prepare Docker or VPN access

Choose host installation, client access or an existing Docker service without treating old application images as a default new stack.

Open topic

Docker services: check the interface and retained state

Choose by protocol, data directory and replacement impact: HTTP, SQL, cache, FastCGI or an image-baked application.

Open topic

Problem pages

Why MySQL 5.7 keeps old credentials after container replacement

The helper reuses /data/mysql5.7/data when replacing mysql57. MySQL initializes accounts only for an empty data directory, so changing install variables does not reset an existing database.

Open page