3.1 docker下安装mysql8
一、环境准备
1、下载安装最新版docker
2、docker pull mysql下载最新的MYSQL
docker pull mysql
3、创建目录
为例:
二、创建窗口
1、核查docker镜像
[root@itpux mysql8]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/mysql latest 102816b1ee7d 10 days ago 486 MB mysql8 v1 102816b1ee7d 10 days ago 486 MB
2、进行安装、查看是否生成成功、登录mysql8容器、登录数据库
[root@itpux mysql8]# docker run -p 3306:3306 --name mysql8 -v $PWD/app/3306/cnf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data/3306/:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql8:v1
c3db441ecac74a1912a3371716c1855f17eff7a3a7e9ec01e790e0eb11a9782a
[root@itpux mysql8]# docker exec -it mysql8 bash
root@c3db441ecac7:/# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.13 MySQL Community Server - GPL
Copyright (c) 2000, 2018, 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>
3、远程登录mysql
浙公网安备 33010602011771号