Easiest way to connect to the database

Hi,
as stated above i am looking for the easiest way to connect to the database, for example over phpmyadmin. All answers are welcome :slight_smile:

My docker-compose.yml file (Old Version, only the timezone was changed):

version: ‘3’

services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_DATABASE: vikunja
volumes:

  • ./db:/var/lib/mysql
    restart: unless-stopped
    api:
    image: vikunja/api
    environment:
    VIKUNJA_DATABASE_HOST: db
    VIKUNJA_DATABASE_PASSWORD: supersecret
    VIKUNJA_DATABASE_TYPE: mysql
    VIKUNJA_DATABASE_USER: root
    VIKUNJA_DATABASE_DATABASE: vikunja
    volumes:
  • ./files:/app/vikunja/files
    depends_on:
  • db
    restart: unless-stopped
    frontend:
    image: vikunja/frontend
    restart: unless-stopped
    proxy:
    image: nginx
    ports:
  • 80:80
    volumes:
  • ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
    depends_on:
  • api
  • frontend
    restart: unless-stopped

An easy way would probably be to just use the pma docker image.

Another way (if you don’t need a gui) would be to just use the mysql cli in the container with something like docker-compose exec db mysql -u root -p vikunja.

I set up all my containers that use MySQL or MariaDB with a second network that I label as “external” (so docker-compose down doesn’t destroy it) that also has a PHPMySQL container attached to it. I don’t make it public or anything, but if I’m on my home network, or VPN’d in, I can get to the PHPMyAdmin instance and log into any of the other containers’ databases.

ProTip: Make sure to add in the “hostname” property on all of the other database containers so that they don’t collide with each other on that second network.