启动容器
docker run --name mysql -p 3306:3306-e MYSQL_ROOT_PASSWORD=123456-d mysql
查询容器
docker ps -a
运行MySQL
docker exec -it c8b02d3ea854 /bin/bash
连接MySQL
mysql -uroot -p
允许MySQL远程连接
mysql>GRANT ALL ON *.* TO 'root'@'%';
mysql> use mysql;
查询密码策略
mysql> select user,plugin from user;
修改为mysql_native_password
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
拉取redis镜像
docker pull redis
docker images
运行redis
#无密码
docker run --name unrequire-redis -p 6379:6379-d redis
#有密码
docker run --name require-redis -p 6579:6379-d redis --requirepass "123456"
#执行
docker exec 容器id redis-cli -a "password"
拉取zookeeper镜像
docker pull zookeeper
docker images
运行zookeeper
docker run --name zookeeper -p 2181:2181-d zookeeper