0

I have a docker-compose with a 'db' and 'web' containers. The db is a mysql:8.0 image, and the web is a python:3.9-slim.

If I try to connect to the MySQL server inside the db container, it works. But not if I try it inside the web container, from where I get the following error:

root@c08888899ca9:/local/app# mysql -h db -u root -p123qwe
ERROR 2061 (HY000): RSA Encryption not supported - caching_sha2_password plugin was built with GnuTLS support

The mysql clients differ between containers: the db client uses the community-mysql client:

mysql  Ver 8.0.28 for Linux on x86_64 (MySQL Community Server - GPL)

while the web container client uses a mariadb-client:

mysql  Ver 15.1 Distrib 10.3.34-MariaDB, for debian-linux-gnu (x86_64)

And, the server version is:

mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.28    |
+-----------+

Any ideas on how to solve the "caching_sha2_password plugin" error

Many thanks in advanced

1 Answers1

0

The possible solutions are:

  • Configure the database server to work without SSL: delete *.pem, set ssl=0 in my.ini or my.cf
  • Rebuild the client with OpenSSL instead of GnuTLS (I suppose it's have an option to select SSL backend and this feature is only supported with OpenSSL.)
  • Change one of containers to match the other: let them both be constructed with MySQL or MariaDB and with compartible configuration. There are plenty of different ready-made MySQL containers as well as web server containers, there shouldn't be a problem to choose ones that work together.
Nikita Kipriyanov
  • 8,033
  • 1
  • 21
  • 39