Your MySQL server is only accepting connections on *nix socket (/var/run/mysqld/mysqld.sock if you’re running Ubuntu) or for localhost only.
You have to edit your my.cnf (on Ubuntu again is located in /etc/mysql/my.cnf) and change the following:
bind-address = 0.0.0.0
And comment out the following
#skip-networking
Finally restart MySQL.
Be careful with that, if your MySQL machine is accessible from public Internet will be accepting connections from everybody!