Hi. Iâve setup a nginx server with PHP-FPM and MariaDB 10.4. The install is failing when it attempts to create the admin user on the database server.
Per the manual I used the root user to connect to the mariadb server (Expecting that it would create the database and nextcloud admin user). When that failed I did some looking and noticed that there appears to have been a change in the way mariadb authentication works since the last time I did this so using the root user on the database server I created a local database admin user:
CREATE USER âadminâ@âlocalhostâ IDENTIFIED BY âAdminPasswordâ;
GRANT ALL PRIVILEGES ON . TO âadminâ@âlocalhostâ WITH GRANT OPTION;
FLUSH PRIVILEGES;
then attempted the setup again with the new admin user. I received the same error. Using both the admin and root users (on the server in the terminal) I checked and saw that the database was created which means the installer was able to connect to the server however the oc_admin user wasnât created.
I thought maybe there was a permission issue with the admin account so (again from the terminal, logged in as the database admin user) I tried to make a âtestuserâ:
CREATE USER âadminâ@âlocalhostâ IDENTIFIED BY âTestPasswordâ;
this worked fine, so it there doesnât appear to be anything wrong with the database server.
At this point Iâm out of ideas. Iâm using PHP 7.3 on FreeBSD with nginx 1.16.1 and nextcloud tar version 17.0.2
CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER nextcloud@localhost identified by 'nextcloud';
GRANT ALL PRIVILEGES on nextcloud.* to nextcloud@localhost;
FLUSH privileges;
quit;
Ok Iâll try this. This isnât my first time installing nextcloud (though itâs been over a year). I never had to create the users by hand in the past. Whatâs changed?
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user ânextcloudâ@âlocalhostâ (using password: YES)
following that I tried mysql -u nextcloud -p and was able to access the server without issue.
I had a look at the MySQL.php code which does the user creating. I donât know enough object oriented PHP but was able to see that it only attempts to create users if there isnât a user identified in config.php. So I created the user as described in the above posts and created a config.php (in the config directory) with minimal configuration information. Just the database setting and user/password settings. Then after failing again (the list of PHP modules in the manual is incomplete) I was able to try yet again and it appears to have installed. I havenât tried it yet, but hopefully everything is complete.
I was also able to run some PHP (on my own) to create a user in SQL and then use that user information to connect to a database⌠exactly what I suspect the installer is doing and everything worked great which seems to indicate that thereâs nothing wrong with my environment. But I donât actually know.