1

Using the rancher GUI, I'm trying to set up Nextcloud with MySQL database workloads on my AKS cluster. In the environment variables, I already have defined the admin user and password so why do I get this error on the create admin page?

Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

I entered the Username and password correctly multiple times. Below are my configurations for the database and nextcloud so far.

database workload:

Name: nextdb
Docker image: mysql
port: not set

I have the following variables:

MYSQL_ROOT_PASSWORD=rootpassX 
MYSQL_DATABASE=nextDB
MYSQL_USER=nextcloud
MYSQL_PASSWORD=passX
  • volumes configuration:

Volume Type: Bind-Mount

Volume Name: nextdb

Path on the Node : /nextdb

The Path on the Node must be: a directory or create

Mount Point: /var/lib/mysql

nextcloud workload:

  • Name: nextcloud

  • Docker Image: nextcloud

  • Port Mapping:

    Port Name : nextcloud80 Publish the container port: 80 Protocol: TCP As a: Layer-4 load balancer On listening port: 80

  • Environment variables:

    MYSQL_DATABASE=nextDB

    MYSQL_USER=nextcloud

    MYSQL_PASSWORD=passX

    MYSQL_HOST=nextdb

    NEXTCLOUD_ADMIN_USER=admin

    NEXTCLOUD_ADMIN_PASSWORD=adminPass

    NEXTCLOUD_DATA_DIR=/var/www/html/nextcloud

  • Volumes:

Volume 1:

name: nextcloud
Volume Type: Bind-Mount
Path on the Node: /nextcloud
The Path on the Node must be: a directory or create.
Mount Point: /var/www/html

Volume 2

name: nextdb
Volume Type: Bind-Mount
Path on the Node: /nextdatabase
The Path on the Node must be: a directory or create.
Mount Point: /var/lib/mysql

What are the problems with my configurations?

Community
  • 1
  • 1
  • you have probably a mysql 8 server and you need as default_authentication_plugin=mysql_native_password in your my.conf file – nbk May 17 '20 at 10:18

1 Answers1

0

Starting with version 8.02, MySQL updated the default authentication method for client connections. To revert to the older authentication method you need to explicitly specify the default authentication method.

If you are able to update your DB service in Rancher to pass the container argument --default-authentication-plugin=mysql_native_password that should revert MySQL to the older auth method.

Alternatively, depending on the MySQL image you are using, you can create a new Docker image from that base which replaces /etc/mysql/my.cnf inside the container. You should inspect /etc/mysql/my.cnf before you replace it, if there are any !includedir directives in the config file, you can place your supplemental configuration into an included folder using whatever filename you choose.

The supplemental configuration should look like this:

[mysqld]
default_authentication_plugin=mysql_native_password
bpdohall
  • 1,046
  • 6
  • 9