Docker installs mysql docker search mysql Search docker pull mysql:5.6 Download docker images |grep mysql View docker run -p 3306:3306 --name mysql_docker -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6 Run command instructions: -p 3306:3306: Maps port 3306 of the container to port 3306 of the host. -v -v $PWD/conf:/etc/mysql/conf.d: Mount conf/my.cnf in the current directory of the host to /etc/mysql/my.cnf in the container. -v $PWD/logs:/logs: mounts the logs directory under the current directory of the host to the /logs of the container. -v $PWD/data:/var/lib/mysql : Mount the data directory under the current directory of the host to /var/lib/mysql of the container. -e MYSQL_ROOT_PASSWORD=123456: Initialize the root user's password. docker ps View the running of the image and enter the container to initialize it after running# mysql -u root -p # create database note; Docker installation redis docker search redis Search docker pull redis:3.2 Download docker images redis View docker run -p 6379:6379 -v $PWD/data:/data -d redis:3.2 redis-server --appendonly yes Run command instructions: -p 6379:6379: Map the container's port 6379 to the host's port 6379 -v $PWD/data:/data: Mount the data in the current directory on the host to the container's /data redis-server --appendonly yes: Execute the redis-server startup command in the container and turn on the redis persistence configuration docker ps to view the running status Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Vue+Bootstrap realizes a simple student management system
>>: View the frequently used SQL statements in MySQL (detailed explanation)
What is a generator? A generator is some code tha...
Table of contents Preface Prepare Implementation ...
Linux: Linux version 3.10.0-123.9.3.el7.x86_64 Ng...
The ECS cloud server created by the historical Li...
Table of contents Introduction Instructions Actua...
A considerable number of websites use digital pagi...
This article example shares the specific code of ...
Table of contents Introduction to NFS Service Wha...
The reason for writing this article is that I wan...
Table of contents Preface Mysql case when syntax:...
ReactRouter implementation ReactRouter is the cor...
1. Overview of SQLException When an error occurs ...
To solve the problem that Deepin cannot start Goo...
Recently, I need to make a back-to-top button whe...
Find the problem I have been learning Django rece...