Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.8K
Visualizações
RSA Encryption not supported - caching_sha2_password with django mysql and docker

im trying to connect Mysql with django using docker, and i get this error

2061, 'RSA Encryption not supported - caching_sha2_password plugin was built with GnuTLS support'.

i tried changing user and creating a database with

// create a user //

CREATE USER 'user'@'localhost' IDENTIFIED BY 'user';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' WITH GRANT OPTION;
CREATE USER 'user'@'%' IDENTIFIED BY 'user';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION;

// create a database //

CREATE DATABASE user_db;

BUT still the sqme error message

in the settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'user_db',
        'USER': 'user',
        'PASSWORD': 'user',
        'HOST': 'db',
        'PORT': '3306',
    }
}

and in docker-compose:

db:
    image: mysql:latest
    environment:
        MYSQL_DATABASE: 'user_db'
        MYSQL_USER: 'user'
        MYSQL_PASSWORD: user
        MYSQL_ROOT_PASSWORD: root
    volumes:
        - ./data/mysql/db:/var/lib/mysql
    ports: 
        - 3306:3306

thank you for your help.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I have solved this changing the conector to mysql-connector-python==8.0.26 instead mysqlclient==2.0.3

Also, connection settings

DATABASES = {
    'default': {
        #'ENGINE':   'django.db.backends.mysql',
        'ENGINE':   'mysql.connector.django',
        'NAME':     getenv('MYSQL_DATABASE'),
        'USER':     getenv('MYSQL_USER'),
        'PASSWORD': getenv('MYSQL_PASSWORD'),
        'HOST':     'db',
        'PORT':     getenv('MYSQL_PORT', 3306),
        'OPTIONS': {
            'auth_plugin': 'mysql_native_password'
        }
    }
}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda