0

On this screens you can see the error that I have

screen1 screen2

This is my docker-compose.yml

 version: '3'

services:

  mysql:
    image: mysql:latest
    restart: always
    ports:
      - 3306:3306
    volumes:
      - ~/workspace/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=soextreme
      - MYSQL_USER=root
      - MYSQL_PASSWORD=root

  gogs:
      image: gogs/gogs:latest
      depends_on:
        - mysql
      restart: always
      ports:
        - 3000:3000
        - "10022:22"
      volumes:
        - ~/workspace/gogs:/data


For note, I found this solution on this link : my docker compose file but it's not working for me, Can you please help me, Thank you.

Mahmoud
  • 1
  • 6
  • I have the same error, and it it not the same issue than https://stackoverflow.com/questions/48668793/docker-gogs-connection-is-refused-by-mysql-container as we are having "this authentication plugin is not supported" it is more related to https://github.com/gogits/gogs/issues/5187 but I could not resolve it – nico May 25 '18 at 08:10

1 Answers1

1

I could make it work with following procedure :

On the mysql Docker, edit the file :

/etc/mysql/my.cnf

and add the line :

default_authentication_plugin=mysql_native_password

then connect as root on the mysql database :

mysql -hdb -P3306 -uroot -p

and execute following statement :

alter user 'gogs'@'%' identified with mysql_native_password by '...'

You can see current configuration with query :

select User, plugin from mysql.user;

On gogs, in the database host :

db:3306

and the connection worked for me.

It may not be necessary to modify authentication plugin in the configuration file once gogs plugin is modified, see by yourself.

nico
  • 460
  • 3
  • 7