localhost is the most specific thing to use. Using anything else will probably not work.
Technical reason for those wondering: If you attempt to connect to MySQL using an IP address, it will use the network TCP/IP stack to communicate, whereas if you specify exactly "localhost" it will use a unix socket file instead. If the servers are configured to disable network connections (haven't checked, but it is a possibility), that means using an IP (even 127.0.0.1) will fail to connect, whereas using "localhost" will work properly.