当前位置:网站首页>Connect to LAN MySQL

Connect to LAN MySQL

2022-07-06 17:17:00 Xiaobai said (๑• ๑)

Connect to the local area network MySql

I met a little problem today , Make a note of .

describe : Different hosts are connected to a host in the LAN MySql database .

Firewall settings

Because of security issues , You cannot turn off the firewall directly , So you need to set inbound rules .

open : The Internet and Internet Set up ->windows A firewall -> Advanced settings .
 Insert picture description here
Enable two rules , Property is set to any IP Address , LAN internal energy ping through MySql Host IP:
 Insert picture description here

Create a new inbound rule : Sure For any local area network IP Open up a 3306 The port of ( I use mysql Port of service ). Operate in sequence .
 Insert picture description here
thus , The opening of LAN ports has been completed .

MySql Service settings

because MySql Only supported by default localhost Make a local visit , The local IP No access to , So we need to open up MySql jurisdiction .

  1. Use the client to connect to the local MySql service , open mysql database ;(use mysql)
  2. Check the corresponding permission IP:SELECT user,host FROM user;
  3. Find that you need open permission ( user ) The interview of IP updated (%):update user set host=’%’ where user=‘ The logged in user root’
  4. restart MySql Service or refresh permissions :FLUSH PRIVILEGES

Now you can access the MySql Database !

原网站

版权声明
本文为[Xiaobai said (๑• ๑)]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060928207657.html