Trouble installing: "You need to enter details of an existing account"

Hi there,

Trying to set up NextCloud on Raspberry Pi Lite OS. Pretty sure I’ve everything set up as needed according to the installation docs, but when using the installation wizard (by using the occ command), I get the following error.

root@raspberrypi:/var/www/nextcloud$ sudo -u www-data php occ  \
maintenance:install --database "mysql" --database-name "nextcloud" \
--database-user "murchu27" --database-pass "mypassword" \
--admin-user "murchu27" --admin-pass "mypassword"

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

I know it’s not an authentication issue, as changing the password gives the expected error (not sure why the forum is formatting differently to above…)

root@raspberrypi:/var/www/nextcloud$ sudo -u www-data php occ  \
maintenance:install --database "mysql" --database-name "nextcloud" \
--database-user "murchu27" --database-pass "wrongpassword" \
--admin-user "murchu27" --admin-pass "wrongpassword"

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 'murchu27'@'localhost' (using password: YES)

I’ve done setup before on Ubuntu Server with no major issues. I’ll happily return to that if needs be since it is supported by Raspberry Pi, just wondering if this is a known issue, or if I’m missing something.

Did you ever solve this problem? I see the same symptom on armbian with the image for v19. Furthermore, if you look at the actual mysql instance, you’ll see that the specified database is created (as specified via --database-name), which means it was definitely able to authenticate.

Afraid not, and yeah the database was created for me too, so I’m not sure where the issue was. I eventually decided Syncthing was more appropriate for my use-case, so I just let it go. Sorry I can’t be of help!

Did you attempt to complete the install on just the raspberry pi or was it in a container of sort?

Really.

Can you check the database?

mysql -u root -p

SHOW DATABASES;

SELECT User FROM mysql.user;

SHOW GRANTS FOR 'murchu27'@'localhost';

See installation and configuration of MariaDB in the middle of the document

https://www.howtoforge.com/tutorial/how-to-install-nextcloud-on-debian-10

Just on the raspberry pi, I’ve a pretty straightforward setup so I couldn’t understand what was going wrong.

I checked the database, and all was definitely as expected - correct grants, database name, etc. (I actually followed that very tutorial at one stage). When I specified a non-existent database, username, or password, the expected error (SQLSTATE[HY000] [1045]) was shown. The other error only showed when I provided all the right details.

In fact, what I saw after more troubleshooting was that, if I repeatedly tried to install (and hence repeatedly generated the error), multiple databases were created, appended with numbers to distinguish them (so nextcloud, nextcloud1, nextcloud2, etc.)

Again, I’m not looking to use nextcloud on my pi anymore, so I won’t be any help in troubleshooting. @shuhao seems to have the same problem as me, so if they manage to fix the issue let me know and I’ll mark the solution!

Nextcloud on Pi use NextcloudPi

https://ownyourbits.com/nextcloudpi/

Figured out the problem: the mysql account used to connect to mysql cannot created users: https://github.com/nextcloud/server/issues/21690.

Once the user used by mysql is created with GRANT OPTION, all is well.