欢迎光临
我们一直在努力

CentOS下使用Docker安装MySQL

最近使用云服务器,学习一下Docker,今天学着使用Docker安装mysql。首先,从阿里云的Docker Hub 上pull一个MySQL的image.

查看下载镜像,就会看到已经有了

名字太长,修改为短的tag

根据镜像创建容器

启动MySQL容器

进入MySQL终端

[centos@liujun ~]$ docker exec -it  2a7a85124400  /bin/bash
root@2a7a85124400:/# mysql -h 127.0.0.1 -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.9 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>

赞(0) 打赏
未经允许不得转载:九八云安全 » CentOS下使用Docker安装MySQL

评论 抢沙发