I created a pull request a while ago that provided the ability to enable/disable plugins. This, however, lead to a some unexpected situations. The qa-base.php file seems not to be so ready to just read from the database at an earlier stage. There were a couple of things to consider which even had an impact on where that file is being imported from.
That particular error comes from the database fail handler not already assigned by the time the database is accessed. So as there is no way to catch the error the Q2A can't figure out if this was an unrecoverable database error or just the user installing the database.
I created a couple of commits that should get this fixed. I don't like them much but might help at least in understanding the issue: https://github.com/q2a/question2answer/pull/477