Laradock: MySQL .env values not applying on container rebuild

Created on 6 Sep 2017  路  3Comments  路  Source: laradock/laradock

Info:

  • Docker version 17.06.1-ce, build 874a737
  • Laradock commit e9806d9bca2aad47a9bb82db969707a21e5981ed
  • System info (Mac, PC, Linux): PC
  • System info disto/version:

Issue:

Inside the laradock folder i am changing the mysql database name/user/pass in the .env file
When i rebuild the containers, it seams the name/user/pass are still the default ones, and the new values are not used at all.
I tried everything; even docker stop $(docker ps -qa) && docker rm $(docker ps -qa) && docker volume rm $(docker volume ls -q) and no success.
Am I doing something wrong?


Expected behavior:

On rebuild to use the new values.


Most helpful comment

I've found the solution.
Laradock saves the mysql data in the "DATA_SAVE_PATH" (my case was C:\Users{yourusername}.laradock\data" and once you build the container for the first time it never overrides it.
What i did, i just removed the "data" folder from ".laradock" and rebuild my containers, and the values in the .env files were applied (Careful as you will lose your databases as well, it is like a complete wipe of the mysql container including any config or data).
From what I understand, it is on purpose so you wont lose data on rebuilding the container (like i've mentioned).
Another solution would be to log in to the mysql container, and change the password in there. (i have not tried this solution)

All 3 comments

same issue.

Hi @ConstantinChirila, please provide more info

diff .env env-sample

I've found the solution.
Laradock saves the mysql data in the "DATA_SAVE_PATH" (my case was C:\Users{yourusername}.laradock\data" and once you build the container for the first time it never overrides it.
What i did, i just removed the "data" folder from ".laradock" and rebuild my containers, and the values in the .env files were applied (Careful as you will lose your databases as well, it is like a complete wipe of the mysql container including any config or data).
From what I understand, it is on purpose so you wont lose data on rebuilding the container (like i've mentioned).
Another solution would be to log in to the mysql container, and change the password in there. (i have not tried this solution)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lcdss picture lcdss  路  3Comments

maurosbu picture maurosbu  路  3Comments

ejblom picture ejblom  路  3Comments

Mahmoudz picture Mahmoudz  路  3Comments

vocanic-saumini picture vocanic-saumini  路  3Comments