2 things:
- Remote access is not allowed by default to root user. It's not a good idea,but you can enable it by running this command:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
- On the other hand, check my.cnf file, find this line
bind-address = 127.0.0.1
and comment it out.
Hope it helps