Hello All, Does anyone know how to connect to loca...
# docker
r
Hello All, Does anyone know how to connect to local DB hosted on docker in WSL2? What host/IP I should use?
b
It should be the normal "localhost:<yourPort>"
r
Not working I'm affraid
Copy code
[08S01]
	Communications link failure

	The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
java.net.ConnectException: Connection refused: connect.
Above is from phpStorm
a
Worked for me but interestingly not from the first attempt. So I deleted and added DB once again.
h
h
It depends do you have mapping of the port or not in the deploy.yml file you use.
Copy code
database:
    engine: mysql
    version: mariadb-10.4
    root:
        username: "root"
        password: "secret"
    endpoints:
        localhost:3306: # this is necessary to have access from the host directly
            protocol: tcp