throw error on connection failure

it happened to me pretty often that run `compound db migrate` and nothing happens because the mysql connection was not established... this one here tells you if that happens