当前位置:网站首页> 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无法被宿主机访问内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- 动作捕捉用于蛇运动分析及蛇形机器人开发
- MySQL教程的天花板,收藏好,慢慢看
- Pit encountered by handwritten ABA
- UE4 blueprint learning chapter (IV) -- process control forloop and whileloop
- 「小程序容器技术」,是噱头还是新风口?
- Financial professionals must read book series 6: equity investment (based on the outline and framework of the CFA exam)
- 机试刷题1
- 金融人士必读书籍系列之六:权益投资(基于cfa考试内容大纲和框架)
- QT signal and slot
- Gd32f4xx serial port receive interrupt and idle interrupt configuration
猜你喜欢

UE4蓝图学习篇(四)--流程控制ForLoop和WhileLoop

Aardio - integrate variable values into a string of text through variable names

ACL 2022 | small sample ner of sequence annotation: dual tower Bert model integrating tag semantics

Export MySQL table data in pure mode

Machine test question 1

案例推荐丨安擎携手伙伴,保障“智慧法院”更加高效

CUDA exploration
![[compilation principle] LR (0) analyzer half done](/img/ec/b13913b5d5c5a63980293f219639a4.png)
[compilation principle] LR (0) analyzer half done

Web APIs DOM time object

#DAYU200体验官# 在DAYU200运行基于ArkUI-eTS的智能晾晒系统页面
随机推荐
Detailed explanation of ThreadLocal
MySQL----初识MySQL
pytorch_ Yolox pruning [with code]
Uniapp setting background image effect demo (sorting)
uniapp设置背景图效果demo(整理)
企业不想换掉用了十年的老系统
Should novice programmers memorize code?
The ceiling of MySQL tutorial. Collect it and take your time
const关键字
memcached
The difference between enumeration and define macro
[IELTS speaking] Anna's oral learning record part1
Signed and unsigned keywords
2022-07-05 use TPCC to conduct sub query test on stonedb
NPM cannot install sharp
Cocoscreator+typescripts write an object pool by themselves
Redis 持久化机制
Extern keyword
动作捕捉用于蛇运动分析及蛇形机器人开发
【LeetCode】19、 删除链表的倒数第 N 个结点