The error you’re getting there is “Access denied”. Normally this happens either when you entered the incorrect credentials for the database user at the start-up.
Your screenshot here seems to be the Docker Compose setup for the RefApp. In our recommended setup, the configuration for the “backend” service looks like this:
backend:
image: openmrs/openmrs-reference-application-3-backend:${TAG:-qa}
restart: "unless-stopped"
depends_on:
- db
environment:
OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
OMRS_CONFIG_CREATE_TABLES: "true"
OMRS_CONFIG_CONNECTION_SERVER: db
OMRS_CONFIG_CONNECTION_DATABASE: openmrs
OMRS_CONFIG_CONNECTION_USERNAME: ${OMRS_DB_USER:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"]
timeout: 5s
volumes:
- openmrs-data:/openmrs/data
And the configuration for the “db” service looks like this:
db:
image: mariadb:10.11.7
restart: "unless-stopped"
command: "mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci"
healthcheck:
test: "mysql --user=${OMRS_DB_USER:-openmrs} --password=${OMRS_DB_PASSWORD:-openmrs} --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
environment:
MYSQL_DATABASE: openmrs
MYSQL_USER: ${OMRS_DB_USER:-openmrs}
MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
volumes:
- db-data:/var/lib/mysql
The key variables here are OMRS_CONFIG_CONNECTION_USERNAME, OMRS_CONFIG_CONNECTION_PASSWORD, MYSQL_USER, and MYSQL_PASSWORD.
By default the db container will create a database user specified by the MYSQL_USER environment variable with the password passed in the MYSQL_PASSWORD environment variable. In our default configuration, we pass in the OMRS_DB_USER environment variable, either from your command line environment or the .env file in the same directory as the docker-compose.yml file.
Notice that in the backend configuration we also have OMRS_CONFIG_CONNECTION_USERNAME set to the same value as MYSQL_USER and OMRS_CONFIG_CONNECTION_PASSWORD set to the same value as MYSQL_PASSWORD. That way, the backend will be starting up trying to connect to the database with the credentials that the database image setup.
Now, without knowing what your Docker Compose setup looks like, I can’t really tell you what may have gone wrong, but hopefully that should be some hints that could point you in the right direction.
Our community of volunteers here on Talk and our other communication channels usually want to help people get working with OpenMRS, but the best way to get help is to help us help you by explaining as clearly and specifically as you can: what you tried, what isn’t working, what configurations you used (either, e.g., through the installation agent or the docker-compose setup or an SDK command, and any logs or system output you can access. The more specific you can be in your ask for help, the more likely someone will be able to unblock you.
You are also welcome to join our community “Coffee Break” calls that exist to help get live support from community experts and volunteers. The schedule for this can be found on our community calendar at om.rs/cal.