[db] fix unit tests for php-5.3 and if localhost is not running mysqld