mysql-container
mysql-container copied to clipboard
Is it possible to create more than one database when init container?
While we use this resposity's image mysql-57-centos7 ,we want to create more than one database when init container. Is it possible to run some commands like
docker container run --detach --name mysql_database -e MYSQL_USER=myuser -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db1,db2,db3 -p 3306:3306 mysql-57-centos7:latest
to create three databases: db1, db2 and db3 when init container?
It is possible to extend the image by mounting some SQL query and a script to a proper place or building you own layer on top of the image. See the "Extending image" section in the doc: https://github.com/sclorg/mysql-container/tree/master/8.0#extending-image
Well, the suggested approach in #287 might be actually a nice enhancement. We'll consider it.