Nextcloud won't accept password

Here is my custom.cnf:

custom.cnf

It looks like they have not enabled the general_log in the config, it could however be, that the they enable at runtime. Would have to look at how it starts. I could also see the timeout parameter, which is set to 5. Me personally, I would put a # in front of that and restart the MySQL / MariaDB server.

Please could you also execute a statement on your database, just to see, if there’s anything wrong with any privileges: (Do this as root user)

SELECT * FROM mysql.user;

Well that doesn’t look good…

mysql -u root -p

Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8607
Server version: 10.3.17-MariaDB-1:10.3.17+maria~bionic-log mariadb.org binary distribution

Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> SELECT * FROM mysql.user;
±-----±------±------------------------------------------±------------±------------±------------±------------±------------±----------±------------±--------------±-------------±----------±-----------±----------------±-----------±-----------±-------------±-----------±----------------------±-----------------±-------------±----------------±-----------------±-----------------±---------------±--------------------±-------------------±-----------------±-----------±-------------±-----------------------±---------±-----------±------------±-------------±--------------±------------±----------------±---------------------±-------±----------------------±-----------------±--------±-------------±-------------------+
| Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv| Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv| Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections| max_user_connections | plugin | authentication_string | password_expired | is_role | default_role | max_statement_time |
±-----±------±------------------------------------------±------------±------------±------------±------------±------------±----------±------------±--------------±-------------±----------±-----------±----------------±-----------±-----------±-------------±-----------±----------------------±-----------------±-------------±----------------±-----------------±-----------------±---------------±--------------------±-------------------±-----------------±-----------±-------------±-----------------------±---------±-----------±------------±-------------±--------------±------------±----------------±---------------------±-------±----------------------±-----------------±--------±-------------±-------------------+
| % | root | *FFCE64C407E518588E1CF6800AD85B5617ACBD77 | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y| Y | Y | Y | Y | Y | Y | Y| Y | | | | | 0 | 0 | 0| 0 | | | N | N | | 0.000000 |
| % | kevin | *FFCE64C407E518588E1CF6800AD85B5617ACBD77 | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N| N | N | N | N | N | N | N| N | | | | | 0 | 0 | 0| 0 | | | N | N | | 0.000000 |
±-----±------±------------------------------------------±------------±------------±------------±------------±------------±----------±------------±--------------±-------------±----------±-----------±----------------±-----------±-----------±-------------±-----------±----------------------±-----------------±-------------±----------------±-----------------±-----------------±---------------±--------------------±-------------------±-----------------±-----------±-------------±-----------------------±---------±-----------±------------±-------------±--------------±------------±----------------±---------------------±-------±----------------------±-----------------±--------±-------------±-------------------+
2 rows in set (0.001 sec)

Try the following but make a backup of that table first!

mysql> GRANT SELECT, INSERT, DELETE, UPDATE ON database.table TO 'kevin'@'%';

Change database and table according to your database server. Now we need to the privileges changes by issuing the command:

mysql> FLUSH PRIVILEGES;

1 Like

so database.table should be mysql.user, correct?

Ah sorry my bad!

mysql> GRANT SELECT, INSERT, DELETE, UPDATE ON database.* TO 'kevin'@'%';

Just change database to your nextcloud database name.

Don’t forget the Flush command afterwards :wink:

1 Like

MariaDB [(none)]> GRANT SELECT, INSERT, DELETE, UPDATE ON nextcloud.* TO ‘kevin’@’%’;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]>

I can finally login to Nextcloud now! I can’t tell you how grateful I am. Thanks so much for all the help!!

If you don’t me asking, what was wrong? I’d like to avoid that happening again if possible.

One last issue - in the webui when I click on Users, I just get a blank page. I am wanting to reset some users passwords.

The problem probably was, that your Nextcloud database user had no permissions to work with the Nextcloud database.

You said though, that you already had data in your Nextcloud, so it must have worked before. This leaves me quite puzzled because if it was working before, the permissions must have been changed at some point. Not sure who changed them.

If you are logged in as admin you can always go to “Settings -> Logging” and see if there is any errors popping up.

I tried again today and now the user page works. Not sure what that was about. But now my wife can’t login via the Android app. I we login on the PC she gets in and she can see her files. But the Android app seems to let her in and the boots her right back to the login screen.

Settings>Logging shows:

Warning core Login failed: ‘danielle’ (Remote IP: ‘172.19.0.4’)

I tried Force Stopping the app and clearing the cache too but it still acts the same. Also uninstalled and reinstalled the app with no luck. The app on my phone logins into my account just fine.

The good news is, she can login on the PC, that way we may be able to fix that as well.

Let her login on the PC and go to “Settings -> Security -> Devices & sessions” - Now remove all the entries which are smartphone related. This way, she will get asked to grant permission upon the next login on the app and should stay in.

That seemed to fix it. Thanks again! I feel bad asking about yet another question since you’ve been so tremendously helpful but if you don’t mind…

The last issue I seem to be having is that after many failed login attempts Nextcloud started showing a message about multiple failed login attempts and the next login will be throttled 30 seconds. I assumed it would disappear after I successfully logged in but it hasn’t. It appears every time my wife or I try to login on both the webui and Android app.

I did some research and found that I needed to purge the entries in the oc_bruteforce_attempts table. Once I did that the error message went away.

Thanks again!!

1 Like