Any way to make NC21 work with MySQL8?

As the title says, is there any way to make NC21 work with MySQL 8(.0.23)?

I just downloaded the NC tarball and installed it on a Kubuntu 20.04.1 LTS server. I also installed all of the missing php modules. I was able to get to the Installation Wizard web page at http://localhost/nextcloud, but therein lies the problem.

I entered an existing username and password combination for my MySQL server on the same host. Despite that, the NC Installation Wizard says:


MySQL username and/or password not valid You need to enter details of an existing account.

I tried another existing account, and received the same error. I created a brand new user, and received the same error. I created a php test script to confirm that php is not the problem, and my test script is able to connect to the database as each of those users, through Apache and a web browser.

The Apache error log reports only:

[Tue Feb 23 18:42:44.234214 2021] [access_compat:error] [pid 17489] [client] AH01797: client denied by server co
nfiguration: /var/www/nextcloud/data/htaccesstest.txt

All of the users were granted β€œall” permissions to the NC database, and permissions were flushed. I restarted MySQL, as well. I tried with and without specifying the MySQL port – as suggested by the Wizard.

All to no avail, as NextCloud remains unable to connect to MySQL.

I tried accounts authenticated by MySQL Native passwords as well as SHA2 passwords – neither work.

Of potential interest, when I use a non-existing database user, I receive this different error:


Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'nobody'@'localhost' (using password: YES)

What, if anything, can be done to get NextCloud to work with MySQL?

Thanks in advance.

Maybe a dumb question? But I’m not sure why you wanna try to login with an existing user to connect nextcloud to the database. Did you create a user and a database for nextcloud?

mysql -uroot -p

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES on nextcloud.* to 'username'@'localhost';
FLUSH privileges;

As I mentioned, I tried both existing and newly-created users, and neither works.