docker 启动mysql步骤
时间: 2023-10-08 17:06:47 浏览: 77
启动Docker和创建MySQL容器的步骤如下:
1. 启动Docker服务:`systemctl start docker` [1]
2. 查询MySQL的官方镜像:`docker search mysql` [1]
3. 下载官方镜像中Stars最高的那个:`docker***1]
4. 查看镜像列表:`docker images` [1]
5. 重命名镜像:`docker***1]
6. 创建MySQL容器:`docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 -d mysql` [1]
接下来是进入MySQL容器的步骤:
7. 进入MySQL容器:`docker exec -it mysql bash` [3]
8. 登录MySQL:`mysql -u root -p"root"`(注意密码没有空格)
9. 在登录时忽略大小写
以上是使用Docker启动MySQL的完整步骤。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [docker教程步骤,以及docker启动mysql步骤演练](https://blog.csdn.net/yubin1285570923/article/details/83316913)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Docker创建Mysql容器的简单步骤](https://download.csdn.net/download/weixin_38565801/14891972)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文