https://supertokens.com/ logo
#general
Title
# general
a

andrew1123

04/18/2022, 7:08 AM
HI everyone, I am new to supertoken and docker, I am trying to follow this instruction to host the core with docker - https://supertokens.com/docs/emailpassword/quick-setup/database-setup/mysql I have a mysql server running at port 3306 and my ip address is 192.168.1.207, I run the docker command with my env variables, and I got an error saying that "Socket fail to connect to host:192.168.1.207, port:3306. Connection refused". What is wrong here? Thank for your help~
r

rp

04/18/2022, 7:08 AM
hey @andrew1123
Is your mysql server listening on all interfaces?
a

andrew1123

04/18/2022, 7:09 AM
yes, I set it to 0.0.0.0
the bind_address
r

rp

04/18/2022, 7:09 AM
And have you changed the "root" user's persmission to allow connecting to it via any address?
Also, the docker's network setting should be bound to the host
a

andrew1123

04/18/2022, 7:14 AM
@rp Thanks, maybe that's the problem. I'll have a try!
@rp I now have a user 'root'@'%' with all privileges, could you give an example or reference on the docker network setting part?
a

andrew1123

04/18/2022, 7:31 AM
Thank you~
I replaced
Copy code
-p 3567:3567
with
Copy code
--network host
, am I doing it correctly?
r

rp

04/18/2022, 7:44 AM
I think u should keep both
a

andrew1123

04/18/2022, 7:48 AM
It said "Published ports are discarded when using host network mode" when I have both🤔 And I have the same connection refused error
r

rp

04/18/2022, 7:49 AM
ah i see. So maybe you don't need
-p 3567:3567
Are you able to reach the mysql server via the mysql CLI?
a

andrew1123

04/18/2022, 7:49 AM
I can reach it via mySQL workbench
r

rp

04/18/2022, 7:50 AM
with host as
192.168.1.207
a

andrew1123

04/18/2022, 7:51 AM
the host name is localhost, so I have to change it to 192.168.1.207?
r

rp

04/18/2022, 7:51 AM
try connecting to the mysql server via mysql workbench with hostname 192.168.1.207
i don't think this is a supertokens' specific issue
a

andrew1123

04/18/2022, 7:53 AM
I got the "failed to connect to MySQL at 192.168.1.207:3306 with user root" from mySQL workbench🤔
r

rp

04/18/2022, 7:53 AM
yea.. so figure out the mysql setup on your computer first 🙂 Then it should work
a

andrew1123

04/18/2022, 7:54 AM
ok, thanks a lot!
7 Views