Jump to content

Trying PS in Docker but can't access MySql database

Recommended Posts



Successfully started PS 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:


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?!





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

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'


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

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

  # Prestashop module. 

    image: prestashop/prestashop
    restart: always
#The volume allows the files to be mounted on the local machine for easy dev work.
       - ./var/www/prestashop:/var/www/html
       - 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

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...

Important Information

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