Exit if can't connect to the DB.