Next, you need to edit the mysql configuration to allow outside hosts to connect:
$ sudo nano /etc/mysql/my.cnf
Look for the line that reads:
bind-address= 127.0.0.1
and comment out that line by placing a # at the beginning.
Then, restart mysql:
$ sudo /etc/init.d/mysql restart