Coder Social home page Coder Social logo

Comments (6)

miladrahimi avatar miladrahimi commented on May 26, 2024

It sometimes need some time for mysql to start. It might because of .env file.
Please make .env file and make sure the values are okey.
Follow this instruction:

docker-compose down
# make/debug your .env file
rm -rf ./docker/mysql
docker-compose up -d
# wait for a minute
docker-compose exec php php artisan migrate

from laravel-docker-compose.

vahidalvandi avatar vahidalvandi commented on May 26, 2024

It sometimes need some time for mysql to start. It might because of .env file. Please make .env file and make sure the values are okey. Follow this instruction:

docker-compose down
# make/debug your .env file
rm -rf ./docker/mysql
docker-compose up -d
# wait for a minute
docker-compose exec php php artisan migrate

this is my .env file

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=vahi4368

I implemented your suggestion but it is still the same. I entered the database and saw that the laravel database is available, but apparently it cannot be connected due to the ports.

I am running this test on an ubuntu 20 cloud server with root access

from laravel-docker-compose.

vahidalvandi avatar vahidalvandi commented on May 26, 2024

i solved it , want to send new pull request to you accept it ?

from laravel-docker-compose.

miladrahimi avatar miladrahimi commented on May 26, 2024

Sure, if it helps i'll merge it.

from laravel-docker-compose.

vahidalvandi avatar vahidalvandi commented on May 26, 2024

I will follow up other cases in other issues and when all cases are resolved in the conditions I am running, I will send a pull request.

Thankful

from laravel-docker-compose.

vahidalvandi avatar vahidalvandi commented on May 26, 2024

#run below to get internal sample_mysql IP

docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)

#open .env and chanege DB_HOST=YOUR-IP-IN-DOCKER

docker-compose exec php php artisan migrate
docker-compose ps

work fine migrate

but after each reset server sample_mysql IP will change

from laravel-docker-compose.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.