docker-compose-laravel
docker-compose-laravel copied to clipboard
How can i access to mysql?
I tried
PS C:\Users\rlawjddn\Desktop\Projects\docker-compose-laravel-main\src> docker-compose run --rm mysql mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)
Anyone help me?
Not sure if still needed, but I access the mysql container with: docker exec -ti mysql bash
docker-compose run --rm
on the mysql container will give issues, because after running docker-composer up --build -d site
the mysql container is already running.
Either follow @ricoderks advice, or if you want you can use a MySQL workbench application or something like TablePlus to access the database container. Just use 127.0.0.1:3306 unless you've changed any of the values in docker-compose.yml
.