My Docker stopped working because database kept restarting

In the last month, I have noticed, that my data migrations stopped working. When I went and actually took a look, I noticed, that my sql database just keep restarting. Looking at the logs, these were the ones, that were at the error level, so most likely the explanation, of what was happening.

[InnoDB] Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB. ... [InnoDB] Cannot boot server version 80021 on data directory built by version 80027. Downgrade is not supportedmysqld: Can't open file: 'mysql.ibd' (errno: 0 - ) ... Failed to initialize DD Storage Engine Data Dictionary initialization failed. Aborting

For one part of the message, I could see in the blog describing the server version error, that one of the reason for this are different MySQL version.

So the first solutions, that I have tried is to update both the Docker and everything installed with he homebrew. I figured out, if I upgrade this, it will somehow work. But the error stayed the same.

Next I was trying to check the different version. The installed version of the database was found with the following command line code, and it was 8.0.28:

mysql -V

I checked the image version with the ones in the docker compose file, and it was 8.0.21.

I have no idea, how to check the different version, that you can use with Docker, since I figured out, that Docker should support any of them. But this is my limited knowledge of containerization talking.

Since MySQL installed on the computer and in the docker compose file were different, that might be the possible problems.

Since I could not find out, how to install a specific MySQL version on Mac, I decided to simply change the MySQL in the docker compose file. And this change did correct the problems described above, so this resolved this problem.

So I guess when they set the specific version in the docker file, it is the time when it stopped working for me. The timing works.

Now, I have heard that recently MySQL was making some breaking changes in their patch version, so this is not the ideal situation. But it would most likely work for local testing of the things, that I develop, so this solution it is for now.