Have you checked the MariaDB/Mysql log what that says?
Was it fully up to date before the update, even plugins?
Might be a caching issue.
Did you check if you can manually connect to the database of that wordpress file with a test file?
Found a nice example on the net.
Create a php file like...