windows10 installation docker run mysql, redis

1, go to Control Panel open the Hyper-v function, you need to set bios if you can not open open

2, mounting docker-desktop

3, using powershell verify whether the installation docker

docker --version

4, docker to create a new network  

docker network create --subnet=172.18.0.0/16 mynetwork

View network list    

docker network ls

5. Create a new route

route -p add 172.18.0.0 MASK 255.255.255.0 10.0.75.2

View the routing list

route print

6, start mysql (designated ip start)

docker run -p 3306:3306 -d --net mynetwork --ip 172.18.0.100 --restart always --name mysql -e MYSQL_ROOT_PASSWORD=root mysql

mysql8 way to change the password, you need to manually set  

Into the docker container

docker exec -it mysql bash

And the way to change the password

use mysql;

select user, host, plugin, authentication_string from user\G;

alter user 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

flush privileges;

7, start redis (designated ip start)

docker run -p 6379:6379 -d --net mynetwork --ip 172.18.0.101 --name redis --restart=always redis-server --appendonly yes --requirepass "root" redis

8, using native tools to test connection

Released six original articles · won praise 4 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_32616177/article/details/103684773