xxxxxxxxxx
sudo ufw allow 3306/tcp
xxxxxxxxxx
#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;
#If you ran above command and accidently
#did not change password for root you can run this:
ALTER USER 'root'@'%' IDENTIFIED BY 'MyNewPass';
xxxxxxxxxx
CREATE USER 'username'@'%' IDENTIFIED BY 'new-password';
FLUSH PRIVILEGES;
xxxxxxxxxx
CREATE USER 'username'@'192.168.1.200' identified by 'new-password';