解决Windows Docker客户端使用Mariadb镜像启动报错

docker-compose.yml文件內容: ``` version: "3" services: mariadb: image: mariadb restart: always volumes: - g:\data\mysql:/var/lib/mysql ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: password ``` 容器跑起来之后就报错了,查看log日志 ``` Initializing database ges than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages! 2019-06-28 2:41:15 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2019-06-28 2:41:15 0 [ERROR] Plugin 'InnoDB' init function returned error. 2019-06-28 2:41:15 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2019-06-28 2:41:15 0 [ERROR] Unknown/unsupported storage engine: InnoDB 2019-06-28 2:41:15 0 [ERROR] Aborting Installation of system tables failed! Examine the logs in my.cnf files. You can ignore these by doing: shell> /usr/bin/mysql_install_db --defaults-file=~/.my.cnf You can also try to start the mysqld daemon with: shell> /usr/sbin/mysqld --skip-grant-tables --general-log & and use the command line tool /usr/bin/mysql to connect to the mysql database and look at the grant tables: shell> /usr/bin/mysql -u root mysql mysql> show tables; Try 'mysqld --help' if you have problems with paths. Using --general-log gives you a log in /var/lib/mysql/ that may be helpful. The latest information about mysql_install_db is available at https://mariadb.com/kb/en/installing-system-tables-mysql_install_db You can find the latest source at https://downloads.mariadb.org and the maria-discuss email list at https://launchpad.net/~maria-discuss Please check all of the above before submitting a bug report at http://mariadb.org/jira ``` ### 解决方法: ``` version: "3" services: mariadb: image: mariadb restart: always volumes: - g:\data\mysql:/var/lib/mysql ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: password command: 'mysqld --innodb-flush-method=fsync' ```

你可能感兴趣的:(解决Windows Docker客户端使用Mariadb镜像启动报错)