当前位置:网站首页> 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无法被宿主机访问内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- config:invalid signature 解决办法和问题排查详解
- Adavit -- dynamic network with adaptive selection of computing structure
- 使用云服务器搭建代理
- [untitled]
- MySQL----初识MySQL
- 项目复盘模板
- Sword finger offer question brushing record 1
- Detailed explanation of ThreadLocal
- NPDP certification | how do product managers communicate across functions / teams?
- OpenSSL:适用TLS与SSL协议的全功能工具包,通用加密库
猜你喜欢

树的先序中序后序遍历

Balanced Multimodal Learning via On-the-fly Gradient Modulation(CVPR2022 oral)

signed、unsigned关键字

Introduction to network basics

【Unity】升级版·Excel数据解析,自动创建对应C#类,自动创建ScriptableObject生成类,自动序列化Asset文件

室内LED显示屏应该怎么选择?这5点注意事项必须考虑在内

Advantages of link local address in IPv6

如何用程序确认当前系统的存储模式?

Rust knowledge mind map XMIND

【编译原理】做了一半的LR(0)分析器
随机推荐
Custom swap function
Adavit -- dynamic network with adaptive selection of computing structure
UDP编程
volatile关键字
The ceiling of MySQL tutorial. Collect it and take your time
Motion capture for snake motion analysis and snake robot development
Gd32f4xx serial port receive interrupt and idle interrupt configuration
European Bioinformatics Institute 2021 highlights report released: nearly 1million proteins have been predicted by alphafold
Config:invalid signature solution and troubleshooting details
Bipartite graph determination
面试题:AOF重写机制,redis面试必问!!!
NPDP certification | how do product managers communicate across functions / teams?
What are the specific steps and schedule of IELTS speaking?
CocosCreator+TypeScripts自己写一个对象池
memcached
OpenSSL: a full-featured toolkit for TLS and SSL protocols, and a general encryption library
Cloud native technology container knowledge points
npm无法安装sharp
室内LED显示屏应该怎么选择?这5点注意事项必须考虑在内
空结构体多大?