I have 2 ubuntu servers lets say X and Y. My sql server is on X. I want to be able to connect and use my database both locally(X) and remotely (Y). I read bunch of tutorials and questions here and I commented out these lines in my.cf as such:
#Bind-address 127.0.0.1 #skip-networking
Then did this:
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP of Y' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
But when I do this I get this error when i want to connect locally.
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysql.sock’