2022-01-30 15:28:48 +01:00
## MariaDB: Aria recovery after crash
If your server crashed and MariaDB logs an error similar to `[ERROR] mysqld: Aria recovery failed. Please run aria_chk -r on all Aria tables (*.MAI) and delete all aria_log.######## files` you may want to try the following to recover the database to a healthy state:
2022-06-23 15:17:00 +02:00
Start the stack and wait until mysql-mailcow begins to report a restarting state. Check by running `docker-compose ps` .
2022-01-30 15:28:48 +01:00
Now run the following commands:
```
# Stop the stack, don't run "down"
2022-06-23 15:17:00 +02:00
docker-compose stop
2022-01-30 15:28:48 +01:00
# Run a bash in the stopped container as user mysql
2022-06-23 15:17:00 +02:00
docker-compose run --rm --entrypoint '/bin/sh -c "gosu mysql bash"' mysql-mailcow
2022-01-30 15:28:48 +01:00
# cd to the SQL data directory
cd /var/lib/mysql
# Run aria_chk
aria_chk --check --force */* .MAI
# Delete aria log files
rm aria_log.*
```
2022-06-23 15:17:00 +02:00
Now run `docker-compose down` followed by `docker-compose up -d` .