windows allows other computers to access the local mysql database

  • Today I was working in the company because I had a local backup database, and the server database crashed, so I asked everyone to connect to my database, but found that they could not connect. I originally thought that as long as I had an ip address and port number, I could pass navicate. I was connected and found that I was wrong. Today I will talk to you about how to let other hosts access your local mysql database

The first thing I think about is whether the firewall is closed, make sure it is closed and continue to look down

Step 1: Go to the control panel and open the firewall

 

2. Click on the inbound rule in the new pop-up page, find in the inbound rule there are two file and printer sharing (echo requests--ICMPv4-In), and then enable the rule

 Step 2: Add inbound rules to allow other computers to access port 3306 of mysql

1. In the first step of the inbound rules page-create a new rule

 

 2. Select the port and click Next

 3. Fill in the 3306 port number and click Next

 

 4. All the way to the next step until you fill in the rule name

 

The third step: modify the mysql database to allow everyone to access

1. Log in to mysql and check the user table

use mysql
select host,user from user;

 

2. Modify the host field

update user set host = '%' where user = 'root';

 

3. Refresh the MySQL system permissions related tables

flush privileges;­

 

Finally done! 

Guess you like

Origin blog.csdn.net/qq_30631063/article/details/109251402