failing to connect local WordPress to SQL Workbench

Halo, I am following this guide to create a local WordPress Setup:
https://davidyeiser.com/tutorials/docker-wordpress-theme-setup
which worked quite well, but now I am trying to connect with MYSQLWorkbench and it never works.

yml file:

version: '3'

services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress:
    depends_on:
      - db
    image: wordpress:5.1.1-php7.3-apache
    ports:
      - "9210:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
    working_dir: /var/www/html
    volumes:
      - ./wp-content:/var/www/html/wp-content
      - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
volumes:
  db_data:

docker ps:
cmd docker ps

my attempt to connect is as followed,

  1. starting MySQLWorkbench
  2. CTRL + U ("Connect to Database")
  3. filled all fields with "wordpress"
    connect to database

and then it always says:
enter image description here

I have tried different combinations of passwords or ports like 33060, but couldn’t get it to connect.

Any Idea what I am missing?

Source: Docker Questions

LEAVE A COMMENT