Distinguish more carefully between different kinds of MySQL connection errors

Authored by epriestley on Jan 21 2016, 8:25 PM.

Description

Distinguish more carefully between different kinds of MySQL connection errors

Summary:
Ref T10195. Root issue: if the MySQL user doesn't have permission to access all the databases, we give them a fairly generic error instead of telling them exactly what's wrong.

Currently, we throw a generic exception on connection failure. Instead, throw a more granular one, and distinguish between bad credentials and no access.

Test Plan: See next revision.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10195

Differential Revision: https://secure.phabricator.com/D15078