Sign inSign up

priyanshuksharma/mysql

By priyanshuksharma

•Updated over 1 year ago

MySQL Docker image for running a relational database, designed for easy setup and use.

Image
Databases & storage
0

107

priyanshuksharma/mysql repository overview

⁠MySQL Docker Image Overview

This is the official MySQL Docker image based on the latest version. It is an open-source relational database management system (RDBMS) used by millions of users worldwide for managing data in a structured format. MySQL is known for its reliability, flexibility, and scalability.

⁠Features:
  • Official MySQL Docker Image: Built from the official MySQL source, ensuring stability and compatibility with various MySQL versions.
  • Easy Setup: Quickly deploy MySQL on your local machine or cloud infrastructure without complicated installation steps.
  • Customizable: Allows you to set environment variables like the root password, database name, and more.
  • Lightweight: Minimal overhead to run MySQL in a Docker container, suitable for local development and testing environments.
  • Multi-Platform Support: Works across multiple operating systems including Linux, macOS, and Windows.
⁠Image Tags:
  • latest: The latest stable version of MySQL.
  • 8.0: MySQL 8.0 version for users requiring specific MySQL features.
⁠Configuration:
  • MYSQL_ROOT_PASSWORD: Set this environment variable to define the root user's password during the container setup.
  • MYSQL_DATABASE: Define the name of a database to be created on initialization.
  • MYSQL_USER & MYSQL_PASSWORD: Optionally, set a non-root user and password for application use.
⁠Usage:

To run the MySQL container with default settings:

docker run --name mysql-container -e MYSQL_ROOT_PASSWORD=my-secret-password -p 3306:3306 -d priyanshuksharma/mysql:latest

To connect to the MySQL server running inside the container:

docker exec -it mysql-container mysql -u root -p
⁠Exposing MySQL Port:

By default, the container exposes port 3306 to allow external applications to connect to the database. This can be mapped to any port on the host machine using the -p option.

⁠Notes:
  • The database server can be easily linked to other containers, enabling multi-container applications like WordPress or PHP applications.
  • The image is optimized for development purposes. For production use, make sure to configure additional settings such as persistent storage and backups.

Tag summary

Content type

Image

Digest

sha256:8689c5f93…

Size

166.2 MB

Last updated

over 1 year ago

docker pull priyanshuksharma/mysql