Windows10 Docker Mariadb InnoDB: Write to file ./ibdata1 failed

错误描述

通过容器日志查到错误信息如下:

2020-01-05 13:06:14 0 [Warning] InnoDB: Retry attempts for writing partial data failed.

2020-01-05 13:06:14 0 [ERROR] InnoDB: Write to file ./ibdata1 failed at offset 0, 1048576 bytes should have been written, only 0 were written. Operating system error number 22. Check that your OS and file system support files of this size. Check also that the disk is not full or a disk quota exceeded.

2020-01-05 13:06:14 0 [ERROR] InnoDB: Error number 22 means ‘Invalid argument’

2020-01-05 13:06:14 0 [ERROR] InnoDB: Could not set the file size of ‘./ibdata1’. Probably out of disk space

2020-01-05 13:06:14 0 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.

2020-01-05 13:06:15 0 [ERROR] Plugin ‘InnoDB’ init function returned error.

2020-01-05 13:06:15 0 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.

2020-01-05 13:06:15 0 [ERROR] Unknown/unsupported storage engine: InnoDB

2020-01-05 13:06:15 0 [ERROR] Aborting

windows10 + Docker 安装 mariadb 时,一安装老是出现以上错误。创建命令如下:

docker run -d -p 3307 --name jmysql -v D:MysqlData:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=jjjjjj mariadb

解决办法

使用以下命令进行创建

docker run -d -p 3307:3306 --name jmysql -v D:MysqlData:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=jjjjjj mariadb --innodb-flush-method=fsync

创建时需要添加:

–innodb-flush-method=fsync

注:重新创建时需要将 d:MysqlData 目录清空并重新建立容器。

腾讯云限时秒杀【点击购买】

搬瓦工,CN2高速线路,1GB带宽,电信联通优化KVM,延迟低,速度快,建站稳定,搬瓦工BandwagonHost VPS优惠码BWH26FXH3HIQ,支持<支付宝> 【点击购买】!

Vultr$3.5日本节点,512M内存/500G流量/1G带宽,电信联通优化,延迟低,速度快【点击购买】!

阿里云香港、新加坡VPS/1核/1G/25G SSD/1T流量/30M带宽/年付¥288【点击购买】

Windows10 Docker Mariadb InnoDB: Write to file ./ibdata1 failed

`微信`扫码 加好友

链接到文章: https://gkxyz.com/windows10-docker-mariadb-innodb-write-to-file-ibdata1-failed.html

推荐站点

评论已关闭