Git Product home page Git Product logo

Comments (3)

dimadeush avatar dimadeush commented on June 24, 2024

Not related to this environment. You have an example in env files and there you can find all database credentials.

from docker-nginx-php-laravel.

falahatiali avatar falahatiali commented on June 24, 2024

excuse me how I can create a new user except root ? I wanna connect database with another user
I have change files as bellow:

 mysql:
      image: mysql:8.0
      container_name: mysql
      restart: always
      command: --default-authentication-plugin=mysql_native_password
      environment:
        - MYSQL_ROOT_PASSWORD=MYPASSWORD!@root
        - MYSQL_USER=myuser
        - MYSQL_DATABASE=mydatabase
        - MYSQL_PASSWORD=MYPASSWORD!@
      ports:
        - "33061:3306"
      volumes:
        - ./storage/mysql-data:/var/lib/mysql
        - ./docker/dev/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=mydatabase
DB_USERNAME=myuser
DB_PASSWORD=MYPASSWORD!@

from docker-nginx-php-laravel.

dimadeush avatar dimadeush commented on June 24, 2024

Pay attention to next row:

  • ./storage/mysql-data:/var/lib/mysql

It means that when starting an image all files in /storage/mysql-data will be mapped into container. If you changed some db environment variables just do next:
1)make stop
2)docker-compose build
3)delete folder /storage/mysql-data
4)make start

Then new "/storage/mysql-data" will be generated and everything will work with your new db credentials.

from docker-nginx-php-laravel.

Related Issues (20)

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.