skip to Main Content

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?

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search