Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.8K
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!