Docker Compose mysql import .sql

前端 未结 5 757
伪装坚强ぢ
伪装坚强ぢ 2021-01-31 16:32

I\'m having trouble importing an .sql dump file with docker-compose. I\'ve followed the docs, which apparently will load the .sql file from docker-entrypoint-initdb.d. However,

5条回答
  •  甜味超标
    2021-01-31 17:02

    This appears on the documentation page of Docker MySQL image: https://hub.docker.com/_/mysql/

    Initializing a fresh instance

    When a container is started for the first time, a new database with the specified name will be created and initialized with the provided configuration variables. Furthermore, it will execute files with extensions .sh, .sql and .sql.gz that are found in /docker-entrypoint-initdb.d. Files will be executed in alphabetical order. You can easily populate your mysql services by mounting a SQL dump into that directory and provide custom images with contributed data. SQL files will be imported by default to the database specified by the MYSQL_DATABASE variable.

提交回复
热议问题