https://sillycodes.com/allow-mysql-remote-root-login-ubuntu-centos-linux/
Mysql remote root access is disabled by default. Now in this tutorial, we will look into how to enable remote MySQL root access.
First of all, open the /etc/mysql/my.cnf file using any of editor. then find the line bind-address. Then comment out that line something like below.
Change line
to
Now, we need to change the permission in MySQL using following command.
Please run the following command in MySQL CLI.
Note: Above command allows root access from all IP Address.
Now we need to add our public IP address ( your desired IP Address ) to the MySQL whitelisted IP address. Please run the following command to enable the root login from IP Address 2.2.2.2.
Note: Please replace IP Address 2.2.2.2 with your desired IP Address.
Then run the following command to make all your changes to affect.
then restart the MySQL server.
On ubuntu:
On centos 7: