The Basics
- Nextcloud Server version (e.g., 29.x.x):
- Latest i guess, i installed it 2 weeks ago but cannot get it from web nor occ command
- Operating system and version (e.g., Ubuntu 24.04):
- Debian GNU/Linux 12
- Web server and version (e.g, Apache 2.4.25):
- Apache/2.4.62
- Database version :
- MariaDB version 10.11.11
- PHP version (e.g, 8.3):
- 8.3.23
- Is this the first time you’ve seen this error? (Yes / No):
- Yes
- When did this problem seem to first start?
- After rebooting the RaspberryPi (first reboot after installation IIRC)
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
- From curl to nextcloudpi install.sh
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
- No
Summary of the issue you are facing:
I get internal server error on Web, and when search in nextcloud.log it says :
“Database creation failed” ConnectionException, Message:“An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied or user nextcld@%”
nextcld is the user i created in the db to match my Nextcloud instance. Passwords were different from config.php and mariadb SHOW PRIVILEGES, so i matched the 2 but it didn’t change a thing. What bothers me, is that it seems it tries to install a db, but I already have one up.
Steps to replicate it (hint: details matter!):
- Connect to Nextcloud URL
- Internal sever error
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":"PJBn7c0sdfZmuTplNXTf","level":3,"time":"2025-06-26T10:36:27+00:00","remoteAddr":"192.168.1.135","user":"--","app":"mysql.setup","method":"POST","url":"/","message":"Database creation failed.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0","version":"31.0.2.1","exception":{"Exception":"Doctrine\\DBAL\\Exception\\ConnectionException","Message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nextcld'@'%' to database 'nextcloud'","Code":1044,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1976,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1918,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1218,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":466,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":440,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/Setup/MySQL.php","line":69,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/Setup/MySQL.php","line":40,"function":"createDatabase","class":"OC\\Setup\\MySQL","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Setup.php","line":299,"function":"setupDatabase","class":"OC\\Setup\\MySQL","type":"->"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":44,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":973,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":101,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nextcld'@'%' to database 'nextcloud'","Code":1044,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","line":39,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1216,"function":"exec","class":"Doctrine\\DBAL\\Driver\\PDO\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":466,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":440,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/Setup/MySQL.php","line":69,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/Setup/MySQL.php","line":40,"function":"createDatabase","class":"OC\\Setup\\MySQL","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Setup.php","line":299,"function":"setupDatabase","class":"OC\\Setup\\MySQL","type":"->"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":44,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":973,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":24,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nextcld'@'%' to database 'nextcloud'","Code":"42000","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","line":33,"function":"exec","class":"PDO","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1216,"function":"exec","class":"Doctrine\\DBAL\\Driver\\PDO\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":466,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":440,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/Setup/MySQL.php","line":69,"function":"executeUpdate","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/Setup/MySQL.php","line":40,"function":"createDatabase","class":"OC\\Setup\\MySQL","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Setup.php","line":299,"function":"setupDatabase","class":"OC\\Setup\\MySQL","type":"->"},{"file":"/var/www/nextcloud/core/Controller/SetupController.php","line":44,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":973,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","Line":33}},"message":"Database creation failed.","exception":{},"CustomMessage":"Database creation failed."}}
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!):
ERROR From DB
Apps
The output of occ app:list (if possible).
Tips for increasing the likelihood of a response
- Use the
preformatted textformatting 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.