当前位置:网站首页>Docker 安装 MySQL
Docker 安装 MySQL
2022-04-23 18:00:00 【浅唱~幸福】
1.查看可用的 MySQL 版本 访问 MySQL 镜像库地址:https://hub.docker.com/_/mysql?tab=tags 。 可以通过 Sort by 查看其他版本的 MySQL,默认是最新版本 mysql:latest
2.我们还可以用 docker search mysql 命令来查看可用版本
3.拉取 MySQL 镜像 这里我拉取是5.7的 命令:docker pull mysql:5.7
4.查看是否已安装了 mysql:
docker images
5.以下命令来运行 mysql 容器:
docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
参数说明:
- -p 3306:3306 :映射容器服务的 3306 端口到宿主机的 3306 端口,外部主机可以直接通过 宿主机ip:3306 访问到 MySQL 的服务。
- MYSQL_ROOT_PASSWORD=123456:设置 MySQL 服务 root 用户的密码。
6.用docker ps 命令查看是否运行:
7. 进入容器 命令:docker exec -it ae2026c8ee58 bash
8.登录mysql
mysql -u root -p
9.授权
授权命令:GRANT ALL PRIVILEGES ON *.* TO [email protected]"%" IDENTIFIED BY "123456";
刷新命令:flush privileges;
退出:exit
10 Navicat连接:
版权声明
本文为[浅唱~幸福]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_39643007/article/details/111587856
边栏推荐
- JS get link? The following parameter name or value, according to the URL? Judge the parameters after
- Submit local warehouse and synchronize code cloud warehouse
- In JS, t, = > Analysis of
- re正则表达式
- 2022年广东省安全员A证第三批(主要负责人)特种作业证考试题库及在线模拟考试
- 2022年流动式起重机司机国家题库模拟考试平台操作
- [UDS unified diagnostic service] IV. typical diagnostic service (6) - input / output control unit (0x2F)
- C#的随机数生成
- Build openstack platform
- The JS timestamp of wechat applet is converted to / 1000 seconds. After six hours and one day, this Friday option calculates the time
猜你喜欢
Process management command
2022江西光伏展,中国分布式光伏展会,南昌太阳能利用展
Element calculation distance and event object
C1 notes [task training chapter I]
MySQL_ 01_ Simple data retrieval
ArcGIS table to excel exceeds the upper limit, conversion failed
In JS, t, = > Analysis of
2022制冷与空调设备运行操作判断题及答案
Clion installation tutorial
Logic regression principle and code implementation
随机推荐
2022 Jiangxi Photovoltaic Exhibition, China Distributed Photovoltaic Exhibition, Nanchang Solar Energy Utilization Exhibition
Array rotation
C language array processing batch data
[UDS unified diagnostic service] IV. typical diagnostic service (4) - online programming function unit (0x34-0x38)
C1 notes [task training chapter I]
Operators in C language
Remember using Ali Font Icon Library for the first time
Utilisation de la liste - Ajouter, supprimer et modifier la requête
Format problems encountered in word typesetting
Eigen learning summary
ES6
Using files to save data (C language)
587. Install fence / Sword finger offer II 014 Anagrams in strings
读取excel,int 数字时间转时间
Batch export ArcGIS attribute table
Amount input box, used for recharge and withdrawal
Solving the problem of displaying too many unique values in ArcGIS partition statistics failed
Go language JSON package usage
Flash - Middleware
Clion installation tutorial