Mysql opens permissions under linux to allow remote login

1 Authorization

login to mysql

mysql -u root -p  

user mysql

UPDATE USER SET host =  '%'  WHERE user =  'root' ; (% allow all hosts to connect)

2 Open mysql port 3306

Open the firewall configuration file:

vi  /etc/sysconfig/iptables 

add one more port

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT 

Note: The added statement of opening port 3306 must be before icmp-host-prohibited, otherwise it will still not be accessible
Restart the firewall
service iptables restart



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324768524&siteId=291194637