Testing a new installation of SilverStripe on Linux (Ubuntu 20.04). My DB Container is set up like this:
...
services:
db:
image: mariadb:10
env_file:
- .env
environment:
MYSQL_ROOT_PASSWORD: ${SS_DATABASE_PASSWORD}
MYSQL_PASSWORD: ${SS_DATABASE_PASSWORD}
MYSQL_USER: ${SS_DATABASE_USERNAME}
MYSQL_DATABASE: ${SS_DATABASE_NAME}
MYSQL_TCP_PORT: ${SS_DATABASE_PORT}
MYSQL_INITDB_SKIP_TZINFO: 0
...
and I have no issues connecting to the container directly. However, when I run my server with something like php -S localhost:8000
, I get the access denied warning:
[Warning] mysqli::real_connect(): (HY000/1045): Access denied for user '<MYSQL_USER>'@'localhost' (using password: YES)
Trying to figure out what is not set properly.