当前位置:网站首页>docker 远程连接 mysql
docker 远程连接 mysql
2022-07-20 05:31:00 【乘风破浪的阿呆】
远程连接服务器中的mysql docker 容器
docker hub上给出的运行mysql步骤是这样的
首先要保证与服务器的网络是通的
Starting a MySQL instance is simple:
$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag
… where some-mysql is the name you want to assign to your container, my-secret-pw is the password to be set for the MySQL root user and tag is the tag specifying the MySQL version you want. See the list above for relevant tags.
我们启动容器后会发现不可以远程连接
那我们希望远程连接的话,我们需要怎么做呢?
1.将容器的端口映射$ docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag
这里我是用的是3306端口
2.
3.
边栏推荐
- Mysql 主从复制 docker集群搭建
- 用户登录Demo
- Centos8 (Linux) 安装 redis
- [dish of learning notes dog learning C] detailed operator
- xshell安装完,启动报错:由于找不到 mfc110.dll,无法继续执行代码。重新安装程序可能会解决此问题
- innobackupex参数说明
- 由两个栈组成的队列
- 找一个数介于两个斐波那契数列之间
- js事件流 (捕获阶段、目标阶段、冒泡阶段)取消浏览器的默认冒泡行为
- Parameters and calls of the [learning notes dish dog learning C] function
猜你喜欢
冒泡排序/堆排序
数仓技术实现
04—— el 和 data 的两种写法
Rpc:thrift framework
[dish of learning notes, dog learning C] first learn operators and original code, inverse code, complement code
Knapsack problem (01 knapsack / full knapsack explanation)
SQL子查询
阿里矢量图库 当前页全选
OpenLayers ol-ext:Transform 对象,旋转、拉伸、放大
Introduction to microservice theory
随机推荐
直接插入排序/希尔排序
【学习笔记之菜Dog学C】初识指针
Flink SQL实现对Kafka的数据处理,写入TiDB
[dish of learning notes dog learning C] function recursion
Redis发布与订阅
列表元素相加
Centos8(linux)安装mysql8.0.28
mongoose使用validate验证, 获取自定义验证信息
蓝桥杯2020年第十一届国赛真题-天干地支
xshell安装完,启动报错:由于找不到 mfc110.dll,无法继续执行代码。重新安装程序可能会解决此问题
P1913 paratroopers in battle
达梦AWR报告提取
TypeScript
list类型转String类型
[dish of learning notes dog learning C] detailed operator
js常见面试题
Better to struggle for the future than regret the past
【学习笔记之菜Dog学C】初识常见关键字、#define定义常量和宏
Flink DataStream API (一)执行环境
页面性能:如何系统地优化页面?