docker
启动docker
service docker start
Ubuntu安装mysql
systemctl start docker(启动) systemctl enable docker(开机自动启动) docker pull mysql(下载Mysql镜像) service firewalld status(查看防火墙,确认关闭) service firewalld stop(关闭防火墙) docker run -p 3306:3306 --name mysql01 -e MYSQL_ROOT_PASSWORD=123456 -d mysql(运行,mysql容器,其中-d表示后台运行,-p主机端口:容器端口 映射 远程连接mysql需要配置如下: docker exec -it mysql01 bash进入容器 mysql -uroot -p 回车输入密码 mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456'; mysql>flush privileges; 刷新配置即可
查看进程:
docker ps -a
进入mysql容器,并登陆mysql
docker exec -it mysql01 bash
查看docker日志
docker logs -f --tail 10 2891c3b4bc98
关闭docker中mysql容器(重启restart)
docker stop mysql01
重启docker
systemctl restart docker
关闭docker
systemctl stop docker
https://blog.csdn.net/m0_38056893/article/details/105611053
Ubuntu下通过docker安装redis
https://blog.csdn.net/weixin_40910372/article/details/103806182