Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the password of mysql on desktop docker in laravel?

After Laravel installation by sail and docker on windows, I run the server by:

./vendaor/bin/sail up -d

and this is the containers:

enter image description here

I can't connect to MySQL by user: root and password and port 3306

docker exec -it app-mysql-1 mysql -u root -p

I delete the app-mysql-1 from app containers and Run a MySQL image but problem still exists and I can't connect to MySQL and make or migrate.

I can find the auto generated MySQL password and can change it but can't connect and use this one in app containers

enter image description here

How I can connect to MySQL in the app containers?

like image 483
Mehdi Yaghoubi Avatar asked Dec 10 '25 21:12

Mehdi Yaghoubi


1 Answers

If you didn't change the default Sail database user then you should use:

User: sail
Password: password

And in ./.env:

DB_USERNAME=sail
DB_PASSWORD=password
like image 148
Thomas Avatar answered Dec 13 '25 10:12

Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!