当前位置:网站首页> 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
2 原因在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无法被宿主机访问内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- Balanced Multimodal Learning via On-the-fly Gradient Modulation(CVPR2022 oral)
- NPDP certification | how do product managers communicate across functions / teams?
- 2022-07-04 the high-performance database engine stonedb of MySQL is compiled and run in centos7.9
- Comparison between variable and "zero value"
- 动作捕捉用于蛇运动分析及蛇形机器人开发
- npm无法安装sharp
- 2022-07-05 stonedb sub query processing parsing time analysis
- UE4 blueprint learning chapter (IV) -- process control forloop and whileloop
- Sword finger offer question brushing record 1
- View
猜你喜欢
Improving Multimodal Accuracy Through Modality Pre-training and Attention
Mysql 身份认证绕过漏洞(CVE-2012-2122)
signed、unsigned关键字
leetcode:面试题 17.24. 子矩阵最大累加和(待研究)
[leetcode] 19. Delete the penultimate node of the linked list
Aardio - construct a multi button component with customplus library +plus
European Bioinformatics Institute 2021 highlights report released: nearly 1million proteins have been predicted by alphafold
Clip +json parsing converts the sound in the video into text
Config:invalid signature solution and troubleshooting details
Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medi
随机推荐
UVa 11732 – strcmp() Anyone?
Signed and unsigned keywords
UDP编程
Slide the uniapp to a certain height and fix an element to the top effect demo (organize)
Puppeteer连接已有Chrome浏览器
ACL 2022 | small sample ner of sequence annotation: dual tower Bert model integrating tag semantics
DR-Net: dual-rotation network with feature map enhancement for medical image segmentation
Financial professionals must read book series 6: equity investment (based on the outline and framework of the CFA exam)
Jafka source analysis processor
npm无法安装sharp
TypeScript获取函数参数类型
Classification, function and usage of MySQL constraints
做国外LEAD2022年下半年几点建议
General implementation and encapsulation of go diversified timing tasks
企业不想换掉用了十年的老系统
Introduction to network basics
View
Aardio - integrate variable values into a string of text through variable names
Plafond du tutoriel MySQL, bien collecté, regardez lentement
Adavit -- dynamic network with adaptive selection of computing structure