In the MediaWiki LocalSettings.php file, make the following update:
Change the value of $wgDBserver from "localhost" to "127.0.0.1" as shown below.
Change from this:
$wgDBserver = "localhost";
$wgDBserver = "127.0.0.1";
Based on information from the following article on Unix socket files vs TCP/IP vs Named Piped on Windows systems:
My "theory" on why the above change corrected the intermittent db connection problem is because the article above indicates that using "localhost" will cause the system to look for a Unix socket file called /tmp/mysql.sock which Bitnami configured in the php.ini file as follows:
However, when you look at the Bitnami mysql installation, there is no mysql.sock file installed under mysql/tmp
I'm guessing that error handling logic in MediaWiki has an exception path that throws an error rather than reverting to TCP/IP when it can't locate the Unix socket file mysql.sock so it throws the db connection error(s) I copied in my previous message while otherwise it simply connects via TCP/IP port 3306.
Therefore, changing "localhost" to "127.0.0.1" forces the logic to always connect via TCP/IP so the problem "appears" corrected as it will no longer search for the missing Unix socket file.