Open richardpatsch opened 8 years ago
Some questions from my side :)
Are you running phundament inside Docker?
Which database do you want to use, also Docker?
Do you have the user user
?
Can you set your user here?
DB_ENV_MYSQL_USER=dev
DB_ENV_MYSQL_PASSWORD=dev123
Can you run docker-compose run php yii db/create
?
Like so:
Kraftbuch:app tobias$ docker-compose run php yii db/create
Creating app_mariadb_1
Checking database connection on DSN 'mysql:host=172.17.0.2;port=3306' with user 'admin'......... [OK]
Creating database 'dev-phundament-4' and granting permissions to user 'dev' on DSN 'mysql:host=172.17.0.2;port=3306' with user 'admin'. [OK]
Kraftbuch:app tobias$
Thx for your response. Yes, I run phunament inside Docker and I use mysql. my DB_ENV_MYSQL_USER is actually dev, I've just copied the varName and wrote a random userName, but in my case its "dev" as well. Your command returns: Interactive mode is not yet supported on Windows. Please pass the -d flag when using 'docker-compose run'. Thx in advance.
Which MySQL image do you use? Could you post your docker-compose.yml
? Some images don't support easy user setup.
Are you running docker-compose
directly from Windows PowerShell(?) or cmd.exe? Which windows version.
I'd definitely like to support the dockerized setup on Windows, but I have no test-setup ... yet.
I execute docker-compose within the "Docker Quickstart Terminal". My docker-compose.yml contains:
# Phundament 4 - Application stack
php:
build: .
links:
- 'mariadb'
nginx:
image: phundament/nginx-one:1.9
links:
- 'php:PHPFPM'
mariadb:
image: 'tutum/mariadb:10.1'
environment:
MARIADB_PASS: secretadmin
Use
php:
build: .
links:
- 'mariadb:DB'
This will prefix ENV variables from the database container with DB_
- Phundament expects this in its config.
Note that links will go away in a future version of Docker.
Still the same outcome, except that i get another IP-address in my error message (172.17.0.3 instead of 172.17.0.1)
Be aware of data loss in your containers!
But, ... did you docker-compose kill && docker-compose rm -fv
?
Could you show the output of docker-compose version
and docker info
.
Version:
docker-compose version 1.5.2, build e5cf49d
docker-py version: 1.5.0
CPython version: 2.7.10
OpenSSL version: OpenSSL 1.0.2a 19 Mar 2015
Info:
Containers: 0
Images: 81
Server Version: 1.9.1
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 81
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.1.13-boot2docker
Operating System: Boot2Docker 1.9.1 (TCL 6.4.1); master : cef800b - Fri Nov 20 19:33:59 UTC 2015
CPUs: 1
Total Memory: 996.2 MiB
Name: default
ID: DXXM:Q26V:OIZP:OKRB:25C3:4HIH:VUSY:MNEM:WT5E:JWW6:BTEW:R6CM
Debug mode (server): true
File Descriptors: 15
Goroutines: 33
System Time: 2016-01-18T19:12:11.130391787Z
EventsListeners: 1
Init SHA1:
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker
Labels:
provider=virtualbox
I tried docker-compose kill && docker-compose rm -fv
now and I when i build/up it again, it's still the same.
Hmmm, I am a bit clueless at the moment. I'll try to get my hands on a Windows system to debug this. What's your Windows version?
... and does it also don't work with a fresh clone?
CC @disco-tex77 @marc7000 @eluhr @Quexer69 If you could test this on Windows, this would be great.
Hi, have the same issue:
Database Exception – yii\db\Exception
SQLSTATE[HY000] [1045] Access denied for user 'dev'@'172.17.0.5' (using password: YES) ↵ Caused by: PDOException
SQLSTATE[HY000] [1045] Access denied for user 'dev'@'172.17.0.5' (using password: YES)
in /app/vendor/yiisoft/yii2/db/Connection.php at line 579
@philippfrenzel Could you double check which command is running in the container? It looks like the startup hasn't completed properly. Which Docker base-image are you using?
Workaround: make bash
In the container ... either try to run sh src/setup.sh
or yii db/create
You may need to update dmstr/yii2-db
and add the command, like so https://github.com/phundament/app/blob/cd8603268186844bdd788d509c3266e5b8579efd/src/config/main.php#L200
didn't had that extension in composer at all? Isn't it added by the dmst meta package?
It is, but maybe your version is too old in your app :) Which meta-package version do you have?
i had to fix tls like this:
docker-machine start default
docker-machine regenerate-certs default
eval "$(docker-machine env default)"
And it's ~2.0.0 ;)
I get the following error: SQLSTATE[HY000] [1045] Access denied for user 'user'@'172.17.0.3' (using password: YES) And when I change the variables:
within the .env file according to the IP+Port I need, there is still the same error.