Ways to allow remote users to log in to access MySQL
To use the root user from any host, password: youpassword (your root password) to connect to the MySQL server:
# mysql-u Root-proot
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' Youpassword ' with GRANT OPTION;
After the operation, remember to perform the following command refresh permissions
FLUSH Privileges
If you are still unable to link, such as:
Error message: Pymysql.err.OperationalError: (2003, "Can ' t connect to MySQL server on ' 192.168.0.102 ' ([Winerror 10061] because the target computer is actively rejecting , unable to connect. )")
Workaround: VIM/ETC/MYSQL/MYSQL.CONF.D/MYSQLD.CNF
If the suspicion is Iptables's problem,
Please use the following command
Iptables-p INPUT ACCEPT
Iptables-p OUTPUT ACCEPT
Temporarily open all ports
There's no command to close iptables on Ubuntu.
This method is only suitable for temporary testing
The Ubuntu deployment of MySQL cannot be remotely linked