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

database/gdb: connect issue with aliyunrds #3755

Closed
chaegumi opened this issue Sep 3, 2024 · 8 comments · Fixed by #3772
Closed

database/gdb: connect issue with aliyunrds #3755

chaegumi opened this issue Sep 3, 2024 · 8 comments · Fixed by #3772
Assignees
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@chaegumi
Copy link

chaegumi commented Sep 3, 2024

Go version

go version go1.22.1 windows/amd64 linux

GoFrame version

v2.7.2

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

error config

database:
    logger:
      level: "all"
      stdout: true
    default:
      link: "mysql:user:pwd@tcp(rdsid.mysql.rds.aliyuncs.com)/dbname?charset=utf8&loc=Local"
      debug: false

correct config

database:
    logger:
      level: "all"
      stdout: true
    default:
      type: "mysql"
      link: "user:pwd@tcp(rdsid.mysql.rds.aliyuncs.com)/dbname?charset=utf8&loc=Local"
      debug: false

What did you see happen?

link with type cannot connect rds

What did you expect to see?

link with type can connect rds

@chaegumi chaegumi added the bug It is confirmed a bug, but don't worry, we'll handle it. label Sep 3, 2024
@houseme
Copy link
Member

houseme commented Sep 13, 2024

在ecs上链接还是本地呢?rds的网络权限开启了ecs访问吗?建议自查

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is it linked to ecs or local? Does the network permission of rds enable ecs access? Recommend self-examination

@chaegumi
Copy link
Author

不像是你说的问题吧,如果是你说的问题,那我不管哪个配置都应该不行才对。
你看我两个配置,把数据库类型简写到link参数不行,但是我独立写type就可以

link: "mysql:user:pwd@tcp(rdsid.mysql.rds.aliyuncs.com)/dbname?charset=utf8&loc=Local"
这样写不能读取到数据

但是我下边这样可以
type:"mysql",
link: "user:pwd@tcp(rdsid.mysql.rds.aliyuncs.com)/dbname?charset=utf8&loc=Local"

我也不知道什么原因

@gqcn gqcn self-assigned this Sep 13, 2024
@gqcn
Copy link
Member

gqcn commented Sep 13, 2024

@chaegumi Let me have a little check.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It doesn't seem to be the problem you mentioned. If it is the problem you mentioned, then no matter which configuration I configure, it should not work.
Look at my two configurations, abbreviating the database type to the link parameter does not work, but I can write the type independently.

link: "mysql:user:pwd@tcp(rdsid.mysql.rds.aliyuncs.com)/dbname?charset=utf8&loc=Local"
Data cannot be read by writing this way

But I can do this down below
type:"mysql",
link: "user:pwd@tcp(rdsid.mysql.rds.aliyuncs.com)/dbname?charset=utf8&loc=Local"

I don't know why

@gqcn
Copy link
Member

gqcn commented Sep 13, 2024

@chaegumi 主要原因是里面缺少了端口引起了,目前你可以在地址中增加端口号绕过该问题,我这边会解决一下这个小细节,感谢反馈 ❤️

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@chaegumi The main reason is that the port is missing. Currently you can add the port number to the address to bypass this problem. I will solve this small detail here. Thanks for the feedback ❤️

@chaegumi
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants