DVWA将密码设为空后仍然无法连接的问题:Could not connect to the MySQL service

目前网上大部分Could not connect to the MySQL service.的问题都告诉你要将config.inc.php文件里的$DVWA[‘db_password’ ] 改为root或者空。但是今天我安装时将密码改为空后仍然无法连接
DVWA将密码设为空后仍然无法连接的问题:Could not connect to the MySQL service
研究了一早上之后,发现问题特别简单,只是因为你的MySQL端口号在根据网上安装教程安装时修改了,只需要在config.inc.php文件中添加你修改后的端口号即可。如下图
DVWA将密码设为空后仍然无法连接的问题:Could not connect to the MySQL service

在服务IP后添加你修改后的端口号即可,我当时修改成3307,故这里添加3307.之后就可以点击Creat / Reset Database按钮,然后进入login页面
DVWA将密码设为空后仍然无法连接的问题:Could not connect to the MySQL service