I am trying to run laravel sail in a project I have inherited, I run vendor/bin/sail up --build
And for some reason it cannot start the DB instance? I get the error
[InnoDB] Cannot boot server version 80032 on data directory built by version 80039. Downgrade is not supported
I am not sure what is going on here or how to resolve. I assumed that sail containerised mysql in it’s image and that it would just build and run. But I seem to have a mysql version conflict somewhere?
If it means anything I am locally running mysql 8.0.32
2
Upgrade the MySQL Version in Sail:
The easiest solution is to make sure the MySQL version in your Sail setup matches or exceeds 8.0.39. Update the docker-compose.yml file in your Laravel project to use MySQL 8.0.39 (or higher).
In your docker-compose.yml, find the MySQL service configuration and update the image to the desired version:
mysql:
image: 'mysql:8.0.39'
# ... other configurations
Remove Existing Data Directory (Only if you can lose the data):
If upgrading is not an option or if the data can be discarded, you can remove the existing MySQL data directory. This will allow MySQL to start fresh with a new, empty data directory.
• Stop the containers:
vendor/bin/sail down
• Remove the data directory:
sudo rm -rf ./docker/mysql/data
• Start Sail again:
vendor/bin/sail up --build