Error While Creating Admin Account in Browser During Initial Setup

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.2
  • Operating system and version (e.g., Ubuntu 24.04):
    • Pop!_OS 22.04
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.52
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Not sure about the proxy if any is used?
  • PHP version (e.g, 8.3):
    • 8.2
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Trying to create the NC Admin Account in Browser
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO?
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • Yes-Cloudflare domain / subdomain

Summary of the issue you are facing:

[Errors when creating the NC Admin Account in the web browser.]

Steps to replicate it (hint: details matter!):

  1. Followed Youtube installation for Ubuntu 22.04 from Learn Linux TV
  2. Tried to create the Nextcloud Admin Account and received this error:
  3. Error while trying to create admin account: An exception occurred in the driver: SQLSTATE[HY000] [1698] Access denied for user ‘nextcloud’@‘localhost’
  4. I used Cloudflare Domain with Subdomain using an ‘A’ record, Content is the IP address of my Hostinger website, Proxy Status is Proxied, TTL is Auto

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"hvNqm5JgrTfVVO4jJAm8","level":3,"time":"2025-04-07T10:42:39+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/","message":"dns_get_record(): A temporary server error occurred. at /var/www/nextcloud.mywebsite.com/lib/private/Http/Client/DnsPinMiddleware.php#99","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0","version":"31.0.2.1","data":{"app":"PHP"}}
{"reqId":"hvNqm5JgrTfVVO4jJAm8","level":3,"time":"2025-04-07T10:42:39+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/","message":"dns_get_record(): A temporary server error occurred. at /var/www/nextcloud.mywebsite.com/lib/private/Http/Client/DnsPinMiddleware.php#99","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0","version":"31.0.2.1","data":{"app":"PHP"}}
{"reqId":"vNhMo1kfZAu2xMVHRats","level":3,"time":"2025-04-07T10:44:45+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"POST","url":"/","message":"dns_get_record(): A temporary server error occurred. at /var/www/nextcloud.mywebsite.com/lib/private/Http/Client/DnsPinMiddleware.php#99","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0","version":"31.0.2.1","data":{"app":"PHP"}}
{"reqId":"vNhMo1kfZAu2xMVHRats","level":3,"time":"2025-04-07T10:44:45+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"POST","url":"/","message":"dns_get_record(): A temporary server error occurred. at /var/www/nextcloud.mywebsite.com/lib/private/Http/Client/DnsPinMiddleware.php#99","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0","version":"31.0.2.1","data":{"app":"PHP"}}

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

Firefox error: Error while trying to create admin account: An exception occurred in the driver: SQLSTATE[HY000] [1698] Access denied for user 'nextcloud'@'localhost'

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET / HTTP/1.1" 200 2315
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /apps/theming/css/default.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 1628
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /core/css/guest.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 4220
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /core/css/server.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 19091
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /core/img/actions/toggle.svg HTTP/1.1" 200 948
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /core/img/actions/caret.svg HTTP/1.1" 200 291
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /dist/core-install.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 35136
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /dist/icons.css HTTP/1.1" 200 38466
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /apps/theming/img/background/jenna-kim-the-globe.webp HTTP/1.1" 200 98876
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /core/img/logo/logo.svg HTTP/1.1" 200 815
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /dist/core-main.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 291844
127.0.0.1 - - [02/Apr/2025:09:54:17 +0700] "GET /dist/core-common.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 1044249
127.0.0.1 - - [02/Apr/2025:09:54:18 +0700] "GET /core/img/favicon-touch.png HTTP/1.1" 200 2553
127.0.0.1 - - [02/Apr/2025:09:54:18 +0700] "GET /core/img/favicon.ico HTTP/1.1" 200 3262
::1 - - [02/Apr/2025:09:54:23 +0700] "OPTIONS * HTTP/1.0" 200 -
::1 - - [02/Apr/2025:09:54:24 +0700] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [02/Apr/2025:10:14:11 +0700] "POST / HTTP/1.1" 200 2515
127.0.0.1 - - [02/Apr/2025:10:14:38 +0700] "POST / HTTP/1.1" 200 2509
127.0.0.1 - - [02/Apr/2025:10:17:12 +0700] "POST / HTTP/1.1" 200 2506
127.0.0.1 - - [02/Apr/2025:10:17:55 +0700] "POST / HTTP/1.1" 200 2529
127.0.0.1 - - [02/Apr/2025:10:18:54 +0700] "POST / HTTP/1.1" 200 2510
127.0.0.1 - - [02/Apr/2025:10:34:48 +0700] "POST / HTTP/1.1" 200 2498
127.0.0.1 - - [02/Apr/2025:10:35:38 +0700] "POST / HTTP/1.1" 200 2518
127.0.0.1 - - [02/Apr/2025:10:39:24 +0700] "POST / HTTP/1.1" 200 2501
127.0.0.1 - - [02/Apr/2025:10:39:55 +0700] "POST / HTTP/1.1" 200 2499
127.0.0.1 - - [02/Apr/2025:10:42:09 +0700] "POST / HTTP/1.1" 200 2520
127.0.0.1 - - [02/Apr/2025:10:42:44 +0700] "POST / HTTP/1.1" 200 2518
127.0.0.1 - - [02/Apr/2025:10:43:25 +0700] "POST / HTTP/1.1" 200 2500
127.0.0.1 - - [02/Apr/2025:10:43:58 +0700] "POST / HTTP/1.1" 200 2501
127.0.0.1 - - [02/Apr/2025:10:44:18 +0700] "POST / HTTP/1.1" 200 2503
127.0.0.1 - - [02/Apr/2025:10:44:49 +0700] "GET / HTTP/1.1" 200 2315
127.0.0.1 - - [02/Apr/2025:10:44:50 +0700] "GET /core/img/actions/caret.svg HTTP/1.1" 200 291
127.0.0.1 - - [02/Apr/2025:10:44:50 +0700] "GET /core/img/actions/toggle.svg HTTP/1.1" 200 948
127.0.0.1 - - [02/Apr/2025:10:44:50 +0700] "GET /core/css/guest.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 4220
127.0.0.1 - - [02/Apr/2025:10:44:50 +0700] "GET /core/css/server.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 19091
127.0.0.1 - - [02/Apr/2025:11:53:33 +0700] "POST / HTTP/1.1" 200 2427
127.0.0.1 - - [02/Apr/2025:11:54:00 +0700] "POST / HTTP/1.1" 200 2528
127.0.0.1 - - [02/Apr/2025:11:55:01 +0700] "POST / HTTP/1.1" 200 2502
127.0.0.1 - - [02/Apr/2025:11:56:34 +0700] "POST / HTTP/1.1" 200 2511
127.0.0.1 - - [02/Apr/2025:11:56:57 +0700] "POST / HTTP/1.1" 200 2515
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET / HTTP/1.1" 200 2320
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /apps/theming/css/default.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 1628
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /core/css/guest.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 4220
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /core/css/server.css?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 19091
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /core/img/actions/caret.svg HTTP/1.1" 200 291
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /core/img/actions/toggle.svg HTTP/1.1" 200 948
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /dist/icons.css HTTP/1.1" 200 38466
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /core/img/logo/logo.svg HTTP/1.1" 200 815
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /apps/theming/img/background/jenna-kim-the-globe.webp HTTP/1.1" 200 98876
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /dist/core-main.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 291844
127.0.0.1 - - [07/Apr/2025:17:42:39 +0700] "GET /dist/core-common.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 1044249
127.0.0.1 - - [07/Apr/2025:17:42:40 +0700] "GET /dist/core-install.js?v=ba222ded25d957b900c03bef914333cd HTTP/1.1" 200 35136
127.0.0.1 - - [07/Apr/2025:17:42:40 +0700] "GET /core/img/favicon-touch.png HTTP/1.1" 200 2553
127.0.0.1 - - [07/Apr/2025:17:42:40 +0700] "GET /core/img/favicon.ico HTTP/1.1" 200 3262
::1 - - [07/Apr/2025:17:42:46 +0700] "OPTIONS * HTTP/1.0" 200 -
::1 - - [07/Apr/2025:17:42:47 +0700] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [07/Apr/2025:17:44:45 +0700] "POST / HTTP/1.1" 200 2512
127.0.0.1 - - [07/Apr/2025:17:48:39 +0700] "POST / HTTP/1.1" 200 2509
127.0.0.1 - - [07/Apr/2025:17:50:01 +0700] "POST / HTTP/1.1" 200 2515
127.0.0.1 - - [07/Apr/2025:17:59:24 +0700] "POST / HTTP/1.1" 200 2503
127.0.0.1 - - [07/Apr/2025:18:00:12 +0700] "POST / HTTP/1.1" 200 2508
127.0.0.1 - - [07/Apr/2025:18:34:15 +0700] "POST / HTTP/1.1" 200 2511
127.0.0.1 - - [07/Apr/2025:18:35:17 +0700] "POST / HTTP/1.1" 200 2514

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocrej03j289i',
  'passwordsalt' => 'KlUjvTVnDtWuUuEFnRvaBpFy982+o6',
  'secret' => 'uM7PhdV3kOWNuXDYwmybEmdk+dMl1UITP5VfAy1ec3ZOHyfa',
  'trusted_domains' =>
  array (
    0 => 'nextcloud.mywebsite.com',
  ),
  'datadirectory' => '/var/www/nextcloud.mywebsite.com/data',
  'dbtype' => 'mysql',
  'version' => '31.0.2.1',
  'overwrite.cli.url' => 'http://nextcloud.mywebsite.com',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
);

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

As the error log already mentioned, it seems that your database user nextcloud as not enough permission to access the database. At first, I would try to give the nextcloud user the needed permissions for the database access.

I’m guessing that you have MariaDB installed, so going to the terminal and typing the following will start the command line for the database:

Note:
Of course, you need to be logged in on the server where Nextcloud is installed.

mariadb -uroot -p

If you’re using MySQL you need to type:

mysql -uroot -p

After that, you’re in a database shell/terminal. We are now giving the nextcloud user the permission it needs to access the database.

GRANT ALL PRIVILEGES on nextcloud.* to 'nextcloud'@'localhost';

After that, you can exit the database shell with typing:

quit;

Do not forget to type ;! :wink:
Reload your services you have like systemctl restart mariadb apache for example or do a reboot of your server.

Hopefully this was the culprit and I did understand it correctly, else do not hesitate to ask, I or someone else sure know to help further. :blush:

:wolf:

1 Like

Thanks for giving examples to start troubleshooting this.
Here’s what I entered into the terminal and the results:

john@nextcloud:~$ mariadb -uroot -p
Enter password:
ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’
john@nextcloud:~$ sudo mariadb -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 37
Server version: 10.6.21-MariaDB-0ubuntu0.22.04.2 Ubuntu 22.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>

john@nextcloud:~$ sudo mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 38
Server version: 10.6.21-MariaDB-0ubuntu0.22.04.2 Ubuntu 22.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>

john@nextcloud:~$ GRANT ALL PRIVILEGES on nextcloud.* to ‘nextcloud’@‘localhost’;
GRANT: command not found
john@nextcloud:~$

Any ideas what to try from these results?
Thanks

Why did you leave the database prompt ?

right there where it says "MariaDB [(none)]> "
that is the point where you enter that GRANT ALL PRIVILEGES… line

if your the database prompt automatically reverts you to the regular command prompt (john@nextcloud:~$ ) … do you have another tool to access your database (e.g. phpMyAdmin) …
open that, login as root, click through until you can write a sql-query … enter that GRANT command there … and send it

Thanks again for the suggestions. Following your comments, this is what occurred:

john@nextcloud:~$ sudo mariadb -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 34
Server version: 10.6.21-MariaDB-0ubuntu0.22.04.2 Ubuntu 22.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> GRANT ALL PRIVILEGES on nextcloud.* to ‘nextcloud’@‘localhost’;
ERROR 1133 (28000): Can’t find any matching row in the user table
MariaDB [(none)]>

john@nextcloud:~$ sudo mariadb -uroot -p mysql -uroot -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 10.6.21-MariaDB-0ubuntu0.22.04.2 Ubuntu 22.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [mysql]> GRANT ALL PRIVILEGES on nextcloud.* to ‘nextcloud’@‘localhost’;
ERROR 1133 (28000): Can’t find any matching row in the user table
MariaDB [mysql]>

How and what do I add within the matching row in the user table?
Thanks for your assistance with this!

and I haven’t used any other tools to access the database but will try out phpMyAdmin as you’ve suggested.
Thanks

it seems to me, that the nextcloud user wasnt even created yet (in the database) .

Is it possible that during nextcloud setup you didnt specify the root database password? … Also most likely the other tables needed for nextcloud weren’t created as well…
I suggest you start over from step 0

Yes, it is a possibility as I’m new to this. It seems the more I troubleshoot this installation, more issues keep coming up.

I did think about starting over, but as you’ve mentioned it as well, I will scrap this install.

Thanks for the assistance with my post. If any additional issues come up with the next install and I can’t find an answer in the NC Community, I will submit another post.

Thanks again.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.