Change the remote machine mysql configuration at /etc/mysql/my.cnf
: change
bind-address = 127.0.0.1
to
#bind-address = 127.0.0.1
On the remote machine, change mysql user permissions with
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password';
IMPORTANT: restart mysql on the remote machine: sudo /etc/init.d/mysql restart