Jump to content
lenp

Trying PS in Docker but can't access MySql database

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

Share this post


Link to post
Share on other sites

I'm also encountering a similar issue. I have started the docker instance with a mysql database running, but for some reason I simply can not connect to it. 

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

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)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More