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

基于中心化部署root无法连接数据库 #406

Open
anyejunwang1 opened this issue Nov 22, 2024 · 1 comment
Open

基于中心化部署root无法连接数据库 #406

anyejunwang1 opened this issue Nov 22, 2024 · 1 comment
Assignees

Comments

@anyejunwang1
Copy link

Issue Type

Others

Have you searched for existing issues?

Yes

Link to Relevant Documentation

No response

Question Details

基于中心化部署拉起镜像切换到root用户之后报错如下:
wxp@wxp-VMware-Virtual-Platform:~/scql$ ./scdbclient prompt --host=http://localhost:8080 --usersConfFileName=examples/scdb-tutorial/client/users.json --sync
# switch to root user
> switch root
root> create database demo
[submit and get]err: Post "http://localhost:8080/public/submit_and_get": read tcp 127.0.0.1:41476->127.0.0.1:8080: read: connection reset by peer
我查看运行日志发现是这样的:
wxp@wxp-VMware-Virtual-Platform:~/scql$ docker logs scdb-tutorial-scdb-1
2024-11-22 21:18:15.11229 INFO main.go:92 Starting to read config file: /home/admin/configs/config.yml
2024-11-22 21:18:15.11229 INFO main.go:110 Starting to connect to database and do bootstrap if necessary...
2024-11-22 21:18:16.11229 INFO logger.go:148 /root/project/pkg/scdb/server/server.go:119
[error] failed to initialize database, got error dial tcp 172.18.0.3:3306: connect: connection refused
2024-11-22 21:18:16.11229 FATAL main.go:114 Failed to connect to database and bootstrap it: dial tcp 172.18.0.3:3306: connect: connection refused
2024-11-22 21:18:56.11229 INFO main.go:92 Starting to read config file: /home/admin/configs/config.yml
2024-11-22 21:18:56.11229 INFO main.go:110 Starting to connect to database and do bootstrap if necessary...
2024-11-22 21:18:56.11229 INFO logger.go:148 /root/project/pkg/scdb/server/server.go:119
[error] failed to initialize database, got error dial tcp 172.18.0.3:3306: connect: connection refused
2024-11-22 21:18:56.11229 FATAL main.go:114 Failed to connect to database and bootstrap it: dial tcp 172.18.0.3:3306: connect: connection refused
2024-11-22 21:19:50.11229 INFO main.go:92 Starting to read config file: /home/admin/configs/config.yml
2024-11-22 21:19:50.11229 INFO main.go:110 Starting to connect to database and do bootstrap if necessary...
2024-11-22 21:19:50.11229 INFO logger.go:148 /root/project/pkg/scdb/server/server.go:119
[error] failed to initialize database, got error dial tcp 172.18.0.3:3306: connect: connection refused
2024-11-22 21:19:50.11229 FATAL main.go:114 Failed to connect to database and bootstrap it: dial tcp 172.18.0.3:3306: connect: connection refused
2024-11-22 21:21:15.11229 INFO main.go:92 Starting to read config file: /home/admin/configs/config.yml
2024-11-22 21:21:15.11229 INFO main.go:110 Starting to connect to database and do bootstrap if necessary...
2024-11-22 21:21:15.11229 INFO logger.go:148 /root/project/pkg/scdb/server/server.go:119
[error] failed to initialize database, got error dial tcp 172.18.0.3:3306: connect: connection refused
2024-11-22 21:21:15.11229 FATAL main.go:114 Failed to connect to database and bootstrap it: dial tcp 172.18.0.3:3306: connect: connection refused
请问这到底是怎么回事呢,为什么我总是连接不上数据库呢,求救!
@zimu-yuxi
Copy link

看是连接被拒绝了,确认下本机是否能够连通mysql,以及数据库帐密配置是否正确

@zimu-yuxi zimu-yuxi self-assigned this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants