The reason why you have to use 127.0.0.1 is MySQL supports both socket connections and TCP/IP connections so as far as the server is concerned they are different address so if you do not have the user set up to be allowed on localhost IE
Code:
grant w/e permissions on database_name.* to 'username'@'localhost' identified by 'userpassword';
it will be denied because MySQL rejects ALL connects you do not setup.
__________________