当前位置:网站首页> DockerMySQL无法被宿主机访问的问题解决
DockerMySQL无法被宿主机访问的问题解决
2022-07-06 15:36:00 【1024问】
1 问题描述
2 原因
3 解决方案
1 问题描述Docker
启动MySQL
容器后,创建一个localhost
访问的用户:
create user [email protected] identified by 'test';
但是在宿主机中无法通过该用户登录:
mycli -u test
在Docker
中的MySQL
创建localhost
的用户只能在Docker
内部访问,而不能通过外部访问。
至于为什么能在宿主机访问root
,是因为默认存在两个root
,分别是:
而test
只有一个localhost
:
创建[email protected]%
或者创建[email protected]
即可:
create user [email protected]% identified by 'test';create user [email protected] identified by 'test';
到此这篇关于Docker MySQL无法被宿主机访问的问题解决的文章就介绍到这了,更多相关Docker MySQL无法被宿主机访问内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- memcached
- return 关键字
- MySQL authentication bypass vulnerability (cve-2012-2122)
- Comparison between variable and "zero value"
- 面试题:AOF重写机制,redis面试必问!!!
- OpenSSL: a full-featured toolkit for TLS and SSL protocols, and a general encryption library
- ICLR 2022 | pre training language model based on anti self attention mechanism
- #DAYU200体验官# 在DAYU200运行基于ArkUI-eTS的智能晾晒系统页面
- Dealing with the crash of QT quick project in offscreen mode
- rust知识思维导图xmind
猜你喜欢
rust知识思维导图xmind
Aardio - integrate variable values into a string of text through variable names
【Unity】升级版·Excel数据解析,自动创建对应C#类,自动创建ScriptableObject生成类,自动序列化Asset文件
Self made j-flash burning tool -- QT calls jlinkarm DLL mode
Leetcode exercise - Sword finger offer 26 Substructure of tree
Matlab tips (27) grey prediction
Designed for decision tree, the National University of Singapore and Tsinghua University jointly proposed a fast and safe federal learning system
ICLR 2022 | 基于对抗自注意力机制的预训练语言模型
浅谈网络安全之文件上传
案例推荐丨安擎携手伙伴,保障“智慧法院”更加高效
随机推荐
Designed for decision tree, the National University of Singapore and Tsinghua University jointly proposed a fast and safe federal learning system
Return keyword
Dealing with the crash of QT quick project in offscreen mode
[step on pit collection] attempting to deserialize object on CUDA device+buff/cache occupy too much +pad_ sequence
UE4蓝图学习篇(四)--流程控制ForLoop和WhileLoop
Windows auzre background operation interface of Microsoft's cloud computing products
视图(view)
poj 1094 Sorting It All Out (拓扑排序)
企业不想换掉用了十年的老系统
ACL 2022 | 序列标注的小样本NER:融合标签语义的双塔BERT模型
如何用程序确认当前系统的存储模式?
OpenSSL:适用TLS与SSL协议的全功能工具包,通用加密库
How big is the empty structure?
OpenNMS separation database
cuda 探索
机试刷题1
#DAYU200体验官# 首页aito视频&Canvas绘制仪表盘(ets)
Improving Multimodal Accuracy Through Modality Pre-training and Attention
云原生技术--- 容器知识点
Typescript get function parameter type