SqlState [Hy000] [2002]

#open /etc/mysql/mysql.conf.d/mysqld.cnf 
#and change
#bind-address            = 127.0.0.1
#to
#bind-address            = 0.0.0.0

#then grant root all privaleges to root
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Tiago F2