1#open /etc/mysql/mysql.conf.d/mysqld.cnf
2#and change
3#bind-address = 127.0.0.1
4#to
5#bind-address = 0.0.0.0
6
7#then grant root all privaleges to root
8GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
9FLUSH PRIVILEGES;
10
11#If you ran above command and accidently
12#did not change password for root you can run this:
13ALTER USER 'root'@'%' IDENTIFIED BY 'MyNewPass';