网站建设资讯

NEWS

网站建设资讯

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>


分享题目:CentOS下使用Docker安装MySQL
转载来于:http://cdysf.com/article/cdcoipe.html