Answer the question
In order to leave comments, you need to log in
How to create 2 users in docker-compose?
What does the creation of two users at the same time look like, there is nothing in the specs, I have already climbed and tried everything:
one is clear
mariadb:
image: mariadb:10.1.30
ports:
- 3306:3306
restart: always
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=newdb
- MYSQL_USER=user1
- MYSQL_PASSWORD=pass
Answer the question
In order to leave comments, you need to log in
The standard API of this image is not suitable for this. You will have to create a user manually using commands
You can create your own image, mariadb and many other databases have their own mechanism for dropping scripts - the /docker-entrypoint-initdb.d/ folder https://github.com/docker-library/mariadb/blob/a8f...
You can try something like this:
FROM mariadb:10.3 #или любая другая версия
COPY create-user.sql /docker-entrypoint-initdb.d/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question