Mysql remote connection

i’m newbie on docker.

I installed.
docker run --name mysql -v D:\mysql\data:/var/lib/mysql -v D:\mysql\config:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=123456 -d mysql

i want to connect to mysql server by SQLyog how can i know ip address container ?

Can you help me? please!

if you want to access your mysql from your host it is generally a good idea to not know the ip, but to map the mysql port from the container to the host.
You can do this by docker run --name mysql.....-p 3306:3306 ...... -d mysql.

1 Like

thanks for your reply.

how can i know ip address container ? because SQLyog need to IP Adress.

if you map the port to your host, you just could use the IP of your host. for example.

1 Like

Thank you. i worked perfectly!