First we will check mysql port in settings file.
It will be located in the MySQL installation directory, e.g. C:\Program Files\MySQL\MySQL Server 8.0\.
Open the. ini configuration file with Notepad and Find the MySQL port that is listening on Windows.
Now we will open port from windows firewall:
1. Open the Control Panel and click Security and then Click Windows Firewall
2. Click Advanced Settings, Inbound Rules.
3. click New Rule and do below step:
> Click Port, then Next.
> Select TCP.
> Enter 3306 in Specific local ports.
> Click Next, then click Allow the connection.
> Check Domain, Private and Public and click next.
4. Enter Name(Port-3306) and click Finish.