nextcloud 无法创建管理员用户

nextcloud can't create an admin user

尝试创建管理员用户时出错:

Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'nextcloud'@'172.22.0.6' (using password: YES)

docker-compose.yml

version: '3'

volumes:
  nextcloud-data:
  nextcloud-db:

networks:
  nginx_network:
    external: true

services:

  app:
    image: nextcloud
    restart: always
    volumes:
      - nextcloud-data:/var/www/html
    environment:
      - MYSQL_PASSWORD=test
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
    networks:
      - nginx_network

  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - nextcloud-db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=test
      - MYSQL_PASSWORD=test
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    networks:
      - nginx_network

我找不到适用于我的解决方案的任何类似问题,docker compose 对我来说似乎没问题

对我有用的解决方案:

  1. 更改了数据库容器的名称
  2. 已删除所有卷

不要将用户设置为 ROOT普通用户就足够了

(如果您在容器之间输入错误的凭据,也会出现此错误)