Uğur Kazdal

I'm a Linux Ent. Who loves PHP, Python, Go and So.

Mysql Docker Container

» devops

Sometimes I use Mysql Container for simple tasks or sample queries. Sometimes I need quick laravel application to handle some API request or to do a job for me.

Anyway, let’s look at the Mysql Container Docker Compose file below,


version: '3.1'

services:

  db:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    ports:  
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: kazdal

–default-authentication-plugin=mysql_native_password this is the command for laravel application if you want to use Mysql 8.

So I hear that you do not want to use mysql shell to check databases, so you can use adminer, so updated docker compose file for mysql is this ;


version: '3.1'
services:

  db:
    image: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    ports:  
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: kazdal

   adminer:
     image: adminer
     restart: always
     ports:
       - 8080:8080

Any Comments to this gist is more than welcome.