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)
Three Paradigms 1NF: Fields are inseparable; 2NF:...
In fact, many companies have functions similar to...
Quickly modify the table structure of a MySQL tab...
I have encountered many problems in learning Dock...
Application scenario 1: Domain name-based redirec...
Being a web designer is not easy. Not only do you...
js execution Lexical analysis phase: includes thr...
Background: I'm working on asset reporting re...
Recently, I'm learning to use React with Thre...
Table of contents Single Node Diff reconcileSingl...
border-radius: CSS3 rounded corners Syntax: borde...
Table of contents Introduction to FTP, FTPS and S...
JavaScript writes a random roll call webpage for ...
This article example shares the specific code of ...
There are three ways to interconnect and communic...