I cant seem to start mysql without providing the IP number:
shell>mysql -h 127.0.0.1 -p #works fine
but
shell>mysql -h localhost -p #gives this error
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
I do have localhost in my /etc/hosts file.
I think the issue is that my mysql.sock file is at the default /tmp location but invoking mysql with a non-IP address makes it look in /var/lib/mysql & I dont know why or how to change it. Nor do I see why this would cause a difference between mysql's treatment of an IP number and an address name such as localhost in this scenario. This could be nothing to do with it of course
I start the server manually (For testing reasons) so I have no /etc/my.cnf so I must be using all default values for client and server.
TIA