CentOs7 mounted mysql8 its remote connection configuration

First, install

Because the Internet has been a detailed installation process, here are their own reference link

Second, the configuration

1, change passwords

   alter user 'username' @ '%' IDENTIFIED BY 'new password';

2, create and modify user permissions to create user 'username' @ '%' identified by 'password';

     If you allow remote connections myql to be here in% ip address

   . Grant all privileges on the database name * to 'user name' @ '%';

   flush privileges;

3, to allow remote connection configuration

  firewall-cmd --zone = public --add-port = 3306 / tcp --permanent # open port

  firewall-cmd --query-port = 3306 / tcp # query port number 3306 whether to open

  firewall-cmd --reload # restart firewall

Command Meaning:

--zone # scope
--add-port = 3306 / tcp # Add port, the format is: port / protocol
--permanent # permanent, this parameter does not restart after failure

Close firewall:

systemctl stop firewalld.service           #停止firewall

systemctl disable firewalld.service # prohibit firewall boot

 

 
 

 

Guess you like

Origin www.cnblogs.com/minrh/p/11586724.html