When we connect trough 127.0.0.1 or localhost, everything works like a charm though when I try to connect to a local IP adress i.e. 192.168.2.1 then connection will not be found.
Most possibly you have permissions to connect to the MySQL server from 'UserName'@'localhost' but not from other hosts. In this case you should have permissions to connect from 'UserName'@'YourHostName'. These are different users from the point of view of MySQL server.