Look just a little harder for my.cnf and the MySQL UNIX socket

These changes take into account the first three locations searched by the MySQL server for the global config, and will try a little harder to find the UNIX socket (on non-Winblows systems) if the socket specified by the user, or obtained from the config either doesn't exist, isn't a file, or isn't a socket. It searches the default locations for Linux, BSD, and Mac OS X; as well as a few other common places.

This helps, especially if you're running on a server where the MySQL config is in a non-standard location, or if as a matter of policy you create a separate config for your app's user with the proper parameters in it.