Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 无法通过 IPv6 地址连接到 MySQL || [Bug]: Unable to connect to MySQL via IPv6 address #2564

Open
greensea opened this issue Jun 17, 2024 · 0 comments
Labels
bug Something isn't working Inactive

Comments

@greensea
Copy link

greensea commented Jun 17, 2024

问题描述 | Describe the bug

部署到 vercel, MYSQL_HOST 环境变量设置为一个 IPv6 地址,MYSQL_PORT 设置为 4406,结果报错

connect EAFNOSUPPORT 240e:353:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:4406 - Local (undefined:undefined)

这应该是在拼接地址的时候直接把 4406 这个端口号拼接到 IPv6 地址后面了,结果导致地址格式错误

如果把 MYSQL_HOST 设置成 [240e:353::xxxx],则报错

getaddrinfo ENOTFOUND [240e:353::xxxx]

这应该是直接把 IP 地址当成域名来解析了

问题网站 | Website URL

https://waline2-8rmoboqyf-greenseas-projects.vercel.app/

服务部署在哪里? | Where your waline deploy?

Vercel (Default)

数据存储在哪里?| Where your comment data store?

MySQL


Problem description | Describe the bug

Deployed to vercel, the MYSQL_HOST environment variable is set to an IPv6 address, MYSQL_PORT is set to 4406, and an error is reported.

connect EAFNOSUPPORT 240e:353:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:4406 - Local (undefined:undefined)

This should be because the port number 4406 was directly spliced ​​to the end of the IPv6 address when splicing the address. As a result, the address format was incorrect.

If MYSQL_HOST is set to [240e:353::xxxx], an error will be reported

getaddrinfo ENOTFOUND [240e:353::xxxx]

This should directly resolve the IP address as a domain name.

Question Website | Website URL

https://waline2-8rmoboqyf-greenseas-projects.vercel.app/

Where is the service deployed? | Where your waline deploy?

Vercel (Default)

Where is the data stored? | Where your comment data store?

MySQL

@greensea greensea added the bug Something isn't working label Jun 17, 2024
@github-actions github-actions bot changed the title [Bug]: 无法通过 IPv6 地址连接到 MySQL [Bug]: 无法通过 IPv6 地址连接到 MySQL || [Bug]: Unable to connect to MySQL via IPv6 address Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Inactive
Projects
None yet
Development

No branches or pull requests

1 participant