Solution :
I had faced the same issue in the recent past and I resolved my issue by following below mentioned simple steps:
1) Allow the remote connecion to MySQL.Edit file:
>sudo nano /etc/mysql/my.cnf
Comment below line:
#bind-address = 127.0.0.1
Restart the MySQL:
>sudo service mysql restart
2) Create new user for remote connection.
>mysql -uroot -p
CREATE USER 'developer'@'localhost' IDENTIFIED BY 'dev_password';
CREATE USER 'developer'@'%' IDENTIFIED BY 'dev_password';
GRANT ALL ON *.* TO 'developer'@'localhost';
GRANT ALL ON *.* TO 'developer'@'%';
3) In my case I needed to connect remotely from my Windows box to VirtualBox machine having Ubuntu. So I needed to allow port 3306 in iptables as follows:
>iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT