mariadb-client cannot connect to db throwing "RSA Encryption not supported"

no flag

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:

| 8.0.28    |

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

Many thanks in advanced

za flag

The possible solutions are:

  • Configure the database server to work without SSL: delete *.pem, set ssl=0 in my.ini or
  • 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.

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.