Jump to content

Trying PS in Docker but can't access MySql database


lenp

Recommended Posts

Hi!

 

Successfully started PS 1.6.1.11 in a Docker container. Also started successfully MySql in its own container. Using MySql client to create a database and a user for PS.

 

I started PS container with a link as suggested on https://hub.docker.com/r/mysql/mysql-server/ with this command:

 

docker run -ti --name prestashop --link prestashop_db:mysql -p 8080:80 -d prestashop/prestashop:1.6.1.11

 

During PS setup, when I enter the details of the database I'm not able to have success with connection.

 

Anyone having guidance on a working setup of the two Docker containers?!

 

regards,

 

/L

Link to comment
Share on other sites

  • 2 years later...

have you tried using a yml docker compose similar to the below. This should run the container but allow all the different services to connect with each other. 

 

# Use root/example as user/password credentials
version: '3.1'

services:

  # Mysql - accessable via adminer 
  db:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_USER: root
      MYSQL_PASSWORD: password
    ports:
      - 3360:3360

#Use this to admininster the databases.
  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

  # Prestashop module. 

  prestashop:
    image: prestashop/prestashop
    restart: always
#The volume allows the files to be mounted on the local machine for easy dev work.
    volumes:
       - ./var/www/prestashop:/var/www/html
    ports:
       - 80:80

run this from the command line like so

@root> docker-compose up

I hope this helps. 

Edited by Seth Wallace (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...