Hi
Nextcloud setup is driving me crazy! Problem is the following message when I go through the setup wizard:
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 'oc_admin'@'172.18.0.1' (using password: YES)
Pre-Info:
I had it working an then it went haywire. See this post.
The oc_admin
-user did not have the privileges to DROP DATABASE
. With the root
-user I couldn’t grant the privileges no matter how hard I tried. Hence I couldn’t delete database content and went for the nuclear option: deleting config and reinstalling from scratch.
System:
Everything is dockerised and at the latest releases. Below my docker-compose file for nextcloud and mariadb the #-sign is to go to a “minimal” working example at which I have not arrived yet. (Allthough, before it went haywire, everything worked like charm when uncommented.)
nextcloud:
image: linuxserver/nextcloud
container_name: nextcloud
environment:
- PUID=48
- PGID=100
- TZ=${TIMEZONE}
volumes:
- /var/hda/files/nextcloud/config:/config
- /var/hda/files/nextcloud/data:/data
- /var/hda/files/Docs:/var/hda/files/Docs
- /var/hda/files/Pictures:/var/hda/files/Pictures
- /var/hda/files/Music:/var/hda/files/Music
# networks:
# - default
# - traefik_proxy
ports:
- 7300:443
depends_on:
- "mariadb"
restart: unless-stopped
mariadb:
image: linuxserver/mariadb
container_name: mariadb
# networks:
# - default
# - traefik_proxy
environment:
- MYSQL_ROOT_PASSWORD=${STEFANPW2}
- MYSQL_ROOT_USER=root
# - MYSQL_DATABASE=nextcloud
- PUID=48
- PGID=100
- TZ=${TIMEZONE}
volumes:
- /var/hda/files/mariadb/config:/config
ports:
- 3307:3306
restart: unless-stopped
When I understand everything correctly there shouldn’t be any compatibility issues.
Details and solutions tried:
-
The connection to the
mariadb
with theroot
-user works: When installing mariadb from scratch, I can login and check for already created databases. Once I clickfinish installation
in the setup wizard, the databasenextcloud
is created (as I entered in the respective field). -
So the problem seems that
root
cannot create theoc_admin
-user allthough it can accessmysql
and create the database
So far I tried:
- Manually creating the
oc_admin
-user and grant respective privileges (one of the solutions suggested in forums). No use: Nextcloud tries to createoc_admin1
with the same issues.
Any ideas? Seriously, it’s driving me nuts - I already spent hours (literaly) trying to solve the problem.
Thank you!