[GH-ISSUE #4317] [Bug?] Changing the docker compose file's Username and password causes a 'ER_ACCESS_DENIED_ERROR' #2777

Open
opened 2026-02-26 07:36:45 +03:00 by kerem · 3 comments
Owner

Originally created by @barrrricade on GitHub (Jan 23, 2025).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4317

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug
I haven't tested this extensively. But i can only get nginx proxy manager working only with the default docker-compose.yaml. I tried using a different password and

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
     # DB_MYSQL_USER: "<changed this>" # doesn't work
      DB_MYSQL_USER: "npm"
      # DB_MYSQL_PASSWORD: "<changed this>" # doesn't work
      DB_MYSQL_PASSWORD: "npm"
      # DB_MYSQL_NAME: "<changed this>" # doesn't work
      DB_MYSQL_NAME: "npm"

    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
  db:
    image: 'jc21/mariadb-aria:latest'
    environment:
# Doesn't work
     # MYSQL_ROOT_PASSWORD: '<changed this>'
     # MYSQL_DATABASE: '<changed this>'
     # MYSQL_USER: '<changed this>'
     # MYSQL_PASSWORD: '<changed this>'

      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'

    volumes:
      - ./mysql:/var/lib/mysql

On a new installation:
If I try to change the Password/usernames I get a: Bad gateway when logging in with admin@example.com and changeme
docker compose logs app shows 'ER_ACCESS_DENIED_ERROR' "Access denied for user 'npm'@'172.21.0.3' (using password: YES)"

I have to use the default's for it to work.

Nginx Proxy Manager Version
v2.11.1

To Reproduce
Steps to reproduce the behavior:
copy the yaml file from above into /opt/nginxproxymanager
change the lines:

      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"

      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'

run docker compose docker compose up -d

Login to localhost:81 and use admin@example.com and changeme.
shows bad gateway

docker compose logs app shows

app-1  |   code: 'ER_ACCESS_DENIED_ERROR',
app-1  |   errno: 1045,
app-1  |   sqlState: '28000',
app-1  |   sqlMessage: "Access denied for user 'npm'@'172.21.0.3' (using password: YES)",

keep the user names and password to npm -> works

Screenshots

Operating System
Ubuntu 22.04.5 x84_64

Additional context
I've tried:

  1. https://github.com/NginxProxyManager/nginx-proxy-manager/issues/577
  2. Deleting the ./data folder https://www.reddit.com/r/nginxproxymanager/comments/o8fer3/er_access_denied_error/
  3. made sure passwords didn't have 'symbols'
  4. made sure that the folders are in the right structure.
Originally created by @barrrricade on GitHub (Jan 23, 2025). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4317 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** I haven't tested this extensively. But i can only get nginx proxy manager working only with the default docker-compose.yaml. I tried using a different password and ``` version: '3' services: app: image: 'jc21/nginx-proxy-manager:latest' ports: - '80:80' - '81:81' - '443:443' environment: DB_MYSQL_HOST: "db" DB_MYSQL_PORT: 3306 # DB_MYSQL_USER: "<changed this>" # doesn't work DB_MYSQL_USER: "npm" # DB_MYSQL_PASSWORD: "<changed this>" # doesn't work DB_MYSQL_PASSWORD: "npm" # DB_MYSQL_NAME: "<changed this>" # doesn't work DB_MYSQL_NAME: "npm" volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt db: image: 'jc21/mariadb-aria:latest' environment: # Doesn't work # MYSQL_ROOT_PASSWORD: '<changed this>' # MYSQL_DATABASE: '<changed this>' # MYSQL_USER: '<changed this>' # MYSQL_PASSWORD: '<changed this>' MYSQL_ROOT_PASSWORD: 'npm' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' volumes: - ./mysql:/var/lib/mysql ``` On a new installation: If I try to change the Password/usernames I get a: Bad gateway when logging in with `admin@example.com` and `changeme` `docker compose logs app` shows 'ER_ACCESS_DENIED_ERROR' ` "Access denied for user 'npm'@'172.21.0.3' (using password: YES)"` I have to use the default's for it to work. **Nginx Proxy Manager Version** v2.11.1 **To Reproduce** Steps to reproduce the behavior: copy the yaml file from above into `/opt/nginxproxymanager` change the lines: ``` DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: "npm" DB_MYSQL_NAME: "npm" MYSQL_ROOT_PASSWORD: 'npm' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' ``` run docker compose `docker compose up -d` Login to localhost:81 and use `admin@example.com` and `changeme`. shows `bad gateway` `docker compose logs app` shows ``` app-1 | code: 'ER_ACCESS_DENIED_ERROR', app-1 | errno: 1045, app-1 | sqlState: '28000', app-1 | sqlMessage: "Access denied for user 'npm'@'172.21.0.3' (using password: YES)", ``` keep the user names and password to npm -> works **Screenshots** <!-- If applicable, add screenshots to help explain your problem. --> **Operating System** Ubuntu 22.04.5 x84_64 **Additional context** I've tried: 1. https://github.com/NginxProxyManager/nginx-proxy-manager/issues/577 2. Deleting the `./data` folder https://www.reddit.com/r/nginxproxymanager/comments/o8fer3/er_access_denied_error/ 3. made sure passwords didn't have 'symbols' 4. made sure that the folders are in the right structure.
Author
Owner

@chrisman1015 commented on GitHub (Mar 12, 2025):

I'm having the same problem. Any luck solving it or a workaround?

<!-- gh-comment-id:2719369519 --> @chrisman1015 commented on GitHub (Mar 12, 2025): I'm having the same problem. Any luck solving it or a workaround?
Author
Owner

@lordmofisto commented on GitHub (Mar 23, 2025):

I was having the same issue.

I narrowed it down to an illegal character in my password for my npm user.

When I originally ran the docker compose, I'm not sure how it set the password but it skipped the portion before the illegal character thus the loaded password from the .env file wouldn't match.

I fixed it by lengthening my password and removing special characters.

I then started fresh:

sudo docker compose down -v --remove-orphans

Removed any existing directories (since my setup was fresh I wasn't worried about losing data)

sudo rm -rf data mysql letsencrypt

Reran the docker compose

sudo docker compose up -d && sudo docker compose logs -f

Worked

<!-- gh-comment-id:2745963522 --> @lordmofisto commented on GitHub (Mar 23, 2025): I was having the same issue. I narrowed it down to an illegal character in my password for my npm user. When I originally ran the docker compose, I'm not sure how it set the password but it skipped the portion before the illegal character thus the loaded password from the .env file wouldn't match. I fixed it by lengthening my password and removing special characters. I then started fresh: `sudo docker compose down -v --remove-orphans` Removed any existing directories (since my setup was fresh I wasn't worried about losing data) `sudo rm -rf data mysql letsencrypt` Reran the docker compose `sudo docker compose up -d && sudo docker compose logs -f` Worked
Author
Owner

@github-actions[bot] commented on GitHub (Sep 25, 2025):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:3331423436 --> @github-actions[bot] commented on GitHub (Sep 25, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#2777
No description provided.