I got this error after attempting to upgrade my nextcloud database that was build using the same compose file as Nextcloud. I was using yobasystems mariadb-alpine:10.x.x. After upgrading via building a new container, I had that error. To fix it I needed to actually run the upgrade command
docker exec -it nextcloud-db /bin/sh -c ‘mysql_upgrade -u root -p nextcloud -h db’
I also had to enter the password when prompt, which should be best practice anyways so important keys dont wind up in your terminal history. The "nextcloud: you see after my " -p " is not a password, but the name of the database.
Note, I don’t have bash so used /bin/sh. I also had to tell it which host to use " -h db ", since it was defaulting to localhost by default. db is my host as set in my compose files and nextcloud config.
Hopefully this will help someone else who ended up here searching for a solution to my same issue. I should get better at reading the documentation for the tools I use before searching for answers.