Comments (5)
MySQL 是装在宿主机吗?
MYSQL_HOST = 127.0.0.1 连不上宿主机 MySQL,你在宿主机执行 ifconfig 看看 docker0 的 IP,有可能是 172.17.0.1,在 Docker 容器里 telnet 这个 IP,能通了删掉容器重新启动一个
from code6.
宿主机安装的mysql,docker0 ip:172.18.0.1
docker run -d -p 8088:80 -e MYSQL_HOST=172.18.0.1 -e MYSQL_PORT=3306 -e MYSQL_DATABASE=code6
能ping通
PING 172.18.0.1 (172.18.0.1) 56(84) bytes of data.
64 bytes from 172.18.0.1: icmp_seq=1 ttl=64 time=0.072 ms
64 bytes from 172.18.0.1: icmp_seq=2 ttl=64 time=0.065 ms
但是依然报同样的错误
from code6.
telnet 172.18.0.1 3306 能通吗
通常连不上都是 iptable 防火墙 和 MySQL 未授权 这几个问题
from code6.
还有一个可能的原因
MySQL 配置文件绑定了 127.0.0.1,注释掉这行(如果有的话):
bind-address = 127.0.0.1
from code6.
👌
from code6.
Related Issues (20)
- Docker-Compose 安装完之后,每次该如何启用,如何关闭? HOT 1
- Windows HOT 2
- 写入账号报错 HOT 3
- 搜索语法能够添加or规则和多个条件匹配吗 HOT 17
- 添加6800个任务无法扫描 HOT 12
- 优化建议 HOT 3
- 一些优化建议 HOT 6
- 容器重启,重新登录提示报错 HOT 6
- 任务列表停止运行 HOT 9
- Docker-Compose 部署方式,宿主机是否需要安装mysql HOT 3
- 请问任务配置支持正则吗? HOT 1
- 扫描没有结果. 日志报错403 HOT 7
- 优化建议 HOT 2
- 安装依赖composer报错 HOT 5
- 使用问题 HOT 4
- 图形界面Docker-Compose 安装找不到账号密码 HOT 1
- 请问【任务配置】-【扫描页数】,这个参数具体是指什么? HOT 3
- 码小六暂停维护说明 2023.04.27 HOT 7
- 数据库连接被拒绝 HOT 2
- 进入容器创建邮箱用户报错 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code6.