[GH-ISSUE #603] Non default database password #508

Closed
opened 2026-02-26 06:33:11 +03:00 by kerem · 1 comment
Owner

Originally created by @ondrousn on GitHub (Sep 10, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/603

Hello, I would like to change default database password, as using just npm does not seem really secure to me.

I changed the password in both docker-compose.yml and config.json files (from documentation), but am now failing with Access denied for user 'npm'@'172.19.0.3' (using password: YES) database error and can not log into web UI.

I tried switching to mysql container with root account and altering the password for npm user and everything works fine after that, but I would like to set the password using json and yaml before running docker-compose up -d.

Please is this somehow possible and where is the problem?

Originally created by @ondrousn on GitHub (Sep 10, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/603 Hello, I would like to change default database password, as using just _npm_ does not seem really secure to me. I changed the password in both _docker-compose.yml_ and _config.json_ files (from documentation), but am now failing with `Access denied for user 'npm'@'172.19.0.3' (using password: YES)` database error and can not log into web UI. I tried switching to mysql container with root account and altering the password for _npm_ user and everything works fine after that, but I would like to set the password using _json_ and _yaml_ before running `docker-compose up -d`. Please is this somehow possible and where is the problem?
kerem 2026-02-26 06:33:11 +03:00
Author
Owner

@andrej-g commented on GitHub (Sep 13, 2020):

The MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD variables are only used when initializing a fresh instance of the MySQL/MariaDB image (see https://hub.docker.com/_/mariadb, Initializing a fresh instance).

So either you'll have to recreate the database container from scratch with your new username/password or drop to the container console and modify the password manually.

edit: in the container console you'll have to specify the hostname/ip to mysql, e.g. "mysql -h 172.xxx.yyy.zzz -u root -p" to force a TCP connection, otherwise it wont connect, for some reason. see: https://mariadb.com/kb/en/installing-and-using-mariadb-via-docker/#connecting-to-mariadb-from-outside-the-container

<!-- gh-comment-id:691684736 --> @andrej-g commented on GitHub (Sep 13, 2020): The MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD variables are only used when initializing a fresh instance of the MySQL/MariaDB image (see https://hub.docker.com/_/mariadb, Initializing a fresh instance). So either you'll have to recreate the database container from scratch with your new username/password or drop to the container console and modify the password manually. edit: in the container console you'll have to specify the hostname/ip to mysql, e.g. "mysql -h 172.xxx.yyy.zzz -u root -p" to force a TCP connection, otherwise it wont connect, for some reason. see: https://mariadb.com/kb/en/installing-and-using-mariadb-via-docker/#connecting-to-mariadb-from-outside-the-container
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#508
No description provided.