2.23. Docker install MySQL

发布时间 :2025-10-25 12:31:04 UTC      

MySQL is the most popular open source database in the world. With its reliability, ease of use, and performance, MySQL has become the database of choice for Web applications.

2.23.1. 1. View the available MySQL versions

Access MySQL Mirror Library address: https://hub.docker.com/_/mysql?tab=tags .

You can view other versions of MySQL through Sort by. The default is the latest version. mysql:latest .

` <../wp-content/uploads/2016/06/docker-mysql1.png>` __

You can also find other versions you want in the drop-down list: ` <../wp-content/uploads/2016/06/docker-mysql2.png>`__

In addition, we can use the docker search mysql command to view the available versions:

$ docker search mysql
NAME                     DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
mysql                    MySQL is a widely used, open-source relati...   2529      [OK]
mysql/mysql-server       Optimized MySQL Server Docker images. Crea...   161                  [OK]
centurylink/mysql        Image containing mysql. Optimized to be li...   45                   [OK]
sameersbn/mysql                                                          36                   [OK]
google/mysql             MySQL server for Google Compute Engine          16                   [OK]
appcontainers/mysql      Centos/Debian Based Customizable MySQL Con...   8                    [OK]
marvambass/mysql         MySQL Server based on Ubuntu 14.04              6                    [OK]
drupaldocker/mysql       MySQL for Drupal                                2                    [OK]
azukiapp/mysql           Docker image to run MySQL by Azuki - http:...   2                    [OK]
...

2.23.2. 2. Pull MySQL image

Here we pull the official image of the latest version:

$ docker pull mysql:latest

` <../wp-content/uploads/2016/06/docker-mysql3.png>` __

2.23.3. 3. View the local image

Use the following command to see if mysql is installed:

$ docker images

` <../wp-content/uploads/2016/06/docker-mysql6.png>` __

You can see in the figure above that we have installed the latest version (latest) of the mysql image.

2.23.4. 4. Run the container

After the installation is complete, we can run the mysql container using the following command:

$ docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql

Parameter description:

  • -p 3306:3306 Map port 3306 of CCS to port 3306 of CDH. External hosts can access MySQL services directly through CDH ip:3306.

  • MYSQL_ROOT_PASSWORD=123456 Set the password for the MySQL service root user

` <../wp-content/uploads/2016/06/docker-mysql4.png>` __

2.23.5. 5. Installation succeeded

Use the docker ps command to see if the installation is successful:

` <../wp-content/uploads/2016/06/docker-mysql5.png>` __

The MySQL service can be accessed locally through root and password 123456.

` <../wp-content/uploads/2016/06/docker-mysql7.png>` __

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.