0

I'm rather new at docker and i am currently having some trouble with my new laravel project

I started a new laravel project using laravel sail, which created a mysql container called organiser_mysql_1

I am able to view my database in my docker container, but when i try to use the same credentials on sequel pro, the database does not show.

docker container:

show databases

Sequel pro:

sequel pro credentials

sequel pro error

docker ps:

docker ps

env file:

env file

database.php

database.php

Command i used to get into docker container:

 docker exec -it organiser_mysql_1 mysql -uroot -p

I can log into sequel pro without the Database: organiser, but the tables in my docker container are not in there.

rsax
  • 1
  • 1

1 Answers1

0

You're probably connecting to to a MySQL server running directly on you host machine (Mac) and not to the one running in your docker container.

To verify:

lsof -i tcp:3306

There is a good chance it shows mysqld running on your Mac

To fix:

  1. Or stop mysqld on your Mac or choose a free port (not 3306) in the next step
  2. Map port 3306 in your container to a port on your Mac. You do this by adding FORWARD_DB_PORT=3307 (or other port) to you .env. This works because of this line.
  3. Restart your containers by running sail stop && sail up -d
online Thomas
  • 8,864
  • 6
  • 44
  • 85