I've got a brand new 4GB RPi4 with LibreElec 9.1.002 / Kodi v18.3 running. Now I'm trying to get Nextcloud working so I installed the linuxserver.io AddOn packges that supply Docker, NextCloud and MariaDB (or should I use tha MariaDB package from the LibreElec team which failed to install?)
Installation is not the problem all seems to work. I can see that MariaDB is running and when browsing to 192.168.2.18 Nextcloud shows the webpage that is supposed to create the admin account and select the type of database and database user.
Whatever I try I always get the error message below:
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000]  No such file or directory
I have specified localhost:3306 and chosen some credentials. I've also tried to create these credentials by hand using the MariaDB docker instance.
create database nextcloud;
create user [email protected] identified by 'xxxxx';
grant all privileges on nextcloud.* to [email protected] identified by 'xxxxx';
What is the proper way to get this working?
You will need the root database login, or any administrator login , and then enter any name you want for your Nextcloud database. Be careful your administrator login needs to have the permissions to create and modify databases and he needs to have the permissions to grant permissions to other users.
After you enter your root or administrator login for your database, the installer creates a special database user with privileges limited to the Nextcloud database. Then Nextcloud needs only the special Nextcloud database user, and drops the root dB login. This user is named for your Nextcloud admin user, with an
oc_prefix, and then given a random password. The Nextcloud database user and password are written into