I want to run mysql on windows using docker container when i try use docker-compose up command on docker-compose file this the result.
> D:\dockerfiles>docker-compose up db_1 | Initializing database db_1 | 2018-10-08T09:00:29.024081Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000) db_1 | 2018-10-08T09:00:29.024224Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000) db_1 | 2018-10-08T09:00:29.024512Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). db_1 | 2018-10-08T09:00:29.028590Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting. db_1 | 2018-10-08T09:00:29.028673Z 0 [ERROR] Aborting db_1 | dockerfiles_db_1 exited with code 1 and this my docker-compose.yml
version: '3.7' services: db: image: mysql:5.7 restart: always environment: MYSQL_ROOT_PASSWORD: pass MYSQL_DATABASE: star MYSQL_USER: user MYSQL_PASSWORD: pass update of docker compose file
version: '3.7' services: mysqldb: image: mysql:5.7 container_name: mysql_con1 command: --default-authentication-plugin=mysql_native_password command: --disable-partition-engine-check restart: always environment: MYSQL_ROOT_PASSWORD: pass MYSQL_DATABASE: star MYSQL_USER: user MYSQL_PASSWORD: pass volumes: - "./:/var/lib/mysql" networks: - samplenet networks: samplenet: driver: nat
{and}for readability.- "./:/var/lib/mysql"is, current directory (./) is not empty. It contains docker-compose file.