Docker Community Forums

Share and learn in the Docker community.

How can I access docker database Remotly?

I have one project on a server which is in docker and I have to access it remotly on different server in laravel. How can I do this?

I have tried by giving hostname as IP address of our server and by giving username and password of db. I have also tried by giving IP access in mysql db. But none is working. I have added following configuration values in .env file:-

'MYSQL_HOST' => '<IP>',
'MYSQL_DATABASE' => '<DATABASE>',
'MYSQL_USER' => '<USER>',
'MYSQL_PASSWORD' => '<PASSWORD>',

Thanks