Home > Back-end >  Error: Installing and using Mariadb on Docker
Error: Installing and using Mariadb on Docker

Time:09-27

I am running this command:

docker run --net mynet --ip IP -p 3306:3306 --mount source=database,target=/var/lib/mysql -e MYSQL_ROOT_PASSWORD=XXXX mariadb:10.5.17 

I get the following error:

Unknown/unsupported storage engine: InnoDB

When I google, I find that I have to remove certain log files and run the following commands:

sudo rm -rf /var/lib/mysql/ib_logfile*   

And then retry, but I get the same error repeatedly. Does anyone have a clue what am I missing here?

CodePudding user response:

docker volume rm database

You need to also delete the volume on the host. Otherwise everytime you restart the container it will pickup an existing setup.

CodePudding user response:

Do NOT ever do anything so fatal to your data as sudo rm -rf /var/lib/mysql/ib_logfile*. Only follow guides of official documentation when doing anything that involved directly touching database files.

The error in your log is "redo log created with MariaDB-10.8.2". The log formats aren't backwards compatible and you are starting with MariaDB-10.5.17 which is why it fails to initialize.

So either start with a MariaDB-10.8.2 container image, or reinitiaize by removing the entire volume data like what Mihai answered.

  • Related