Skip to content
Advertisement

Can’t connect to localhost mysql

I am trying to get my app working with docker but I am having trouble getting my database to display. It seems my laravel application itself can access it but I need to access it myself in order to troubleshoot issues.

The problem when I try to access localhost:4306 (the port of which the db is on). when I go to that in the browser it outputs:

JavaScript

The db section of the .env is:

JavaScript

the docker-compose is:

JavaScript

and the Dockerfile referenced in the docker-compose.yml is:

JavaScript

Advertisement

Answer

You are trying to connect to database through HTTP protocol, that’s why you are receiving that message.

You can connect to MySql database using phpMyAdmin (web client) or any installed MySql client.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement