How to connect MySQL Server in wampserver

Open port will cause a security issue, so do that ONLY for dev or debug

I trust we all know that we should set an account for remote access in MySQL, such as


grant all on example_db.* on "example_user"@"%" identified by "your password";
flush privileges;

So, the reason is not misconfig of MySQL, it’s windows firewall, we have to open port by follow actions.

Search(win+Q)->Firewall-> Windows Defender Firewall-> inbound rule

create rule -> port -> release 3306 (sorry I don’t know what is it in English version)

如何远程连接wamp环境下的MySQL

开放端口会导致安全问题,因此,请保证只用于debug或开发环境

相信各位都知道,MySQL远程访问需要新建账户,例如


grant all on example_db.* on "example_user"@"%" identified by "your password";
flush privileges;

所以导致无法访问的罪魁祸首不是mysql,是windows防火墙,我们需要使用下列操作步骤来开放3306端口。

搜索->防火墙->高级安全 Windows Defender 防火墙->入站规则

新建规则->端口->放行3306