dnhsoft / sw-docker-demo

Shopware Docker Demo Files
17 stars 10 forks source link

Using dnhsoft/shopware:4.0.1 Gives PDOException #2

Closed dciccale closed 7 years ago

dciccale commented 7 years ago

When running the following docker-compose.yml file

shop:
  image: dnhsoft/shopware:4.0.1
  links:
   - db
   - mailhog
  ports:
   - "8000:80"

db:
  image: dnhsoft/mysql-utf8:5.7
  volumes:
   - ".database:/var/lib/mysql"

pma:
  image: dnhsoft/phpmyadmin:4.6.3
  links:
   - db
  ports:
   - "8001:80"

mailhog:
  image: mailhog/mailhog
  expose:
   - "1025"
   - "8025"
  ports:
   - "8025:8025"

docker-compose up -d and going to http://127.0.0.1 I get this error:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'admin'@'172.17.0.4' (using password: YES)' in /shopware/engine/Library/Zend/Db/Adapter/Pdo/Abstract.php:129 Stack trace: #0 /shopware/engine/Library/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:dbname=sh...', 'admin', '123456', Array) #1 /shopware/engine/Library/Zend/Db/Adapter/Pdo/Mysql.php(109): Zend_Db_Adapter_Pdo_Abstract->_connect() #2 /shopware/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(92): Zend_Db_Adapter_Pdo_Mysql->_connect() #3 /shopware/engine/Library/Zend/Db/Adapter/Abstract.php(315): Enlight_Components_Db_Adapter_Pdo_Mysql->_connect() #4 /shopware/engine/Shopware/Bootstrap.php(155): Zend_Db_Adapter_Abstract->getConnection() #5 [internal function]: Shopware_Bootstrap->initDb() #6 /shopware/engine/Library/Enlight/Bootstrap.php(304): call_user_func(Array) #7 /shopware/engine/Library/Enlight/Bootstrap.php(258): Enlight_Bootstrap->loadResource('Db') #8 /shopware/engine/Shopw in /shopware/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php on line 101

What could this possibly be? Thanks in advance for any help

chudomir-delchev-dnh commented 7 years ago

Sorry to hear you had this problem.

Here is a correct docker-compose.yml file for your case:

shop:
  image: dnhsoft/shopware:4.0.1
  links:
   - db
   - mailhog
  ports:
   - "8000:80"
  environment:
   SWDB_USER: "root"

db:
  image: dnhsoft/mysql-utf8:5.6
  volumes:
   - ".database:/var/lib/mysql"
  environment:
   MYSQL_ROOT_PASSWORD: 123456

pma:
  image: dnhsoft/phpmyadmin:4.6.3
  links:
   - db
  ports:
   - "8001:80"

mailhog:
  image: mailhog/mailhog
  expose:
   - "1025"
   - "8025"
  ports:
   - "8025:8025"
chudomir-delchev-dnh commented 7 years ago

Call docker-compose up -d and then docker-compose exec shop /swtools/init.sh

dciccale commented 7 years ago

It worked! thanks a lot @chudomir-delchev-dnh one more question:

For version 5+ it already comes with an /swtools/install-demo-data-en.sh script which I run that installs a ton of demo data in english for my installation. Is there such thing for version 4 that I can download from somewhere and insert to mysql?

great docker image btw. it helps a lot for development.

chudomir-delchev-dnh commented 7 years ago

THanks for the feedback :)

For Shopware 4, unfortunately there is no such script - at that time it was a manual process.

There are predefined images for Shopware in our docker hub repo. They are suffixed with ".d". However, they start from Showpare 4.1, for example dnhsoft/shopware:4.1.0.d . Would that be ok for you?

(Really sorry for the late replies!)

dciccale commented 7 years ago

That is amazing! thanks a lot.

I will use that image then.

This issue can be closed :)

On Jun 22, 2017 15:01, "Chudomir Delchev" notifications@github.com wrote:

THanks for the feedback :)

For Shopware 4, unfortunately there is no such script - at that time it was a manual process.

There are predefined images for Shopware in our docker hub repo. They are suffixed with ".d". However, they start from Showpare 4.1, for example dnhsoft/shopware:4.1.0.d . Would that be ok for you?

(Really sorry for the late replies!)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dnhsoft/sw-docker-demo/issues/2#issuecomment-310373259, or mute the thread https://github.com/notifications/unsubscribe-auth/AAg7mhwUVUbAkmiz3NpN3eDTopUCvmvZks5sGmW_gaJpZM4N1QM2 .

chudomir-delchev-dnh commented 7 years ago

Just let me know if you have problems with the images with demo data.