View MySQL environment parameters in Docker

Source: Internet
Author: User

Welcome to the big Data and AI technical articles released by the public number: Qing Research Academy, where you can learn the night white (author's pen name) carefully organized notes, let us make a little progress every day, so that excellent become a habit!

From the official documentation you can see that the command to run the MySQL container is:

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=mypwd -d mysql:tag

Such as:docker run --name mysqldb -e MYSQL_ROOT_PASSWORD=123456 -p 3336:3306 -d mysql:5.7

Description

docker run: Run container

--name: Specifies the container name, the name specified here is calledmysqldb

-e: Specifies the environment parameter, which e is environment the abbreviation for the environment parameters that can be specified when running the MySQL container:

    MYSQL_ROOT_PASSWORD : root用户的密码,这里设置的初始化密码为`123456`;    MYSQL_DATABASE : 运行时需要创建的数据库名称;    MYSQL_USER : 运行时需要创建用户名,与MYSQL_PASSWORD一起使用;    MYSQL_PASSWORD : 运行时需要创建的用户名对应的密码,与MYSQL_USER一起使用;    MYSQL_ALLOW_EMPTY_PASSWORD : 是否允许root用户的密码为空,该参数对应的值为:yes;    MYSQL_RANDOM_ROOT_PASSWORD:为root用户生成随机密码;    MYSQL_ONETIME_PASSWORD : 设置root用户的密码必须在第一次登陆时修改(只对5.6以上的版本支持)。    MYSQL_ROOT_PASSWORD 和 MYSQL_RANDOM_ROOT_PASSWORD 两者必须有且只有一个。

-p 3336:3306: The port number in the external mapping container, where the container is 3306 mapped to an externally accessible 3336 port

-d: Running in the background

mysql:5.7: Run 5.7 of this version of MySQL

This article explains how to look up mirrors in hub.docker.com, as well as some Docker commands, and explains some of the most common commands for Docker in the next section.

This article from the "Knowledge Forest"

View MySQL environment parameters in Docker

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.