Hi,
it’s my first time trying to install InvoiceNinja on an Ubuntu Host in Docker.
When I use the default config of password ninja for user ninja everything works and I can use InvoiceNinja just fine:
DB_PASSWORD=ninja
MYSQL_PASSWORD=ninja
But as soon as I change the password to a custom one (keeping both db and mysql password the same), I get this error:
app-1 | SQLSTATE[HY000] [1045] Access denied for user 'ninja'@'172.18.0.4' (using p
app-1 | assword: YES) (Connection: mysql, SQL: select exists (select 1 from informa
app-1 | tion_schema.tables where table_schema = 'ninja' and table_name = 'migration
app-1 | s' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED')) as `exists`)
Change the DB_ROOT_PASSWORD, DB_PASSWORD, MYSQL_PASSWORD and MYSQL_ROOT_PASSWORD to two custom but different passwords
docker compose up (I changed the passwords before the first start)
Expected Behavior
If I understood correctly, invoiceninja is creating the db and all the accounts with correct passwords. This does not seem to be the case.
Logs
app-1 | In Connection.php line 825:
app-1 |
app-1 | SQLSTATE[HY000] [1045] Access denied for user 'ninja'@'172.18.0.4' (using p
app-1 | assword: YES) (Connection: mysql, SQL: select exists (select 1 from informa
app-1 | tion_schema.tables where table_schema = 'ninja' and table_name = 'migration
app-1 | s' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED')) as `exists`)
app-1 |
app-1 |
app-1 | In Connector.php line 66:
app-1 |
app-1 | SQLSTATE[HY000] [1045] Access denied for user 'ninja'@'172.18.0.4' (using p
app-1 | assword: YES)
app-1 |
The storage:link command fails with the message ERROR The [public/storage] link already exists., so I think the storage link is already ok. The other .env variables didn’t change the error.
I believe that when you start the container for the first time, if the database db container has not been created yet, then the db credentials set at that point in time will be used to create the root db user and db user.
If you later change them to another value, that will not change anything. You will want to remove the database image completely. Set your preferred db credentials. And then start up the containers again.