I haven't been able to get error 2006. I can simulate the error message that says "MySql server has gone away" by not running mysqld. Although I also get the "Failed to connect to database" message too.
Another way to simulate this is to not have db.ini point to your database (usually its 127.0.0.1) or not use mysql admin user/password.
So if you first message is "Failed to connect..." then its:
1) mysqld not running
2) db.ini not pointing to 127.0.0.1 or wherever you database is
3) user/password is not a mysql admin user (db.ini)
|