I’m setting up Nextcloud on an Ubuntu Server (18.10) using a LEMP stack. I’ve installed Nextcloud but when I try to finish I get an error message that reads:
Error when trying to create admin user:
Failed to connect to the database: An
exception occurred in driver:
SQLSTATE[HY000]  Access denied
for user ‘root’@‘localhost’
I’m sure I’m missing a simple setting but I can’t figure out where. Can anyone help?
This simple step is essential if you want to access a database. You need to provide a valid database administrator account so that the installation can be done. You’ve not written which database you’re using but if it is e.g. MariaDB you should check-out how to administer users and access rights on the folliwng page: https://mariadb.com/kb/en/library/user-account-management/
The following SQL command e.g. will show you the list of existing database users:
# mysql -e "use mysql;SELECT user,host,select_priv,insert_priv,grant_priv FROM user;"
Okay, I’ve set up an admin user on MariaDB and granted it all privileges on the nextclouddb database. Still getting the same error, though.
Good news! I restarted MariaDB, tweaked a setting or two, and voila! I was able to finish the setup.
Since I’m about to try to install and configure Mariadb for NextCloud, by all means, please share the setting or two that you tweaked.
I’m so sorry, I
don’t remember what settings I tweaked, but if you check out
linuxbabe.com, she has an excellent tutorial, and responds to
questions and pleas for help quickly. No affiliation, just a
very satisfied user.
Thank you! I appreciate it.