搭建DVWA环境异常,Php7.3.9连接mysql8

软件

DVWA
PHP version: 7.3.9
MySql version:8.0.16 MySQL Community Server - GPL
xampp-windows-x64-7.3.9-0-VC15-installer

问题描述:

点击创建数据库时,总是提示错误:

Could not connect to the MySQL service.
Please check the config file.

解决办法:

修改mysql配置文件my.ini,重启mysql
原始值:

# default_authentication_plugin=caching_sha2_password

修改为:

default_authentication_plugin=mysql_native_password

创建用户:dvwa_user

CREATE USER 'dvwa_user'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY '123456';
GRANT ALL PRIVILEGES ON dvwa.* TO 'dvwa_user'@'127.0.0.1';
flush privileges;

配置Config.inc.php

$_DVWA[ ‘db_server’ ] = ‘127.0.0.1’;
$_DVWA[ ‘db_database’ ] = ‘dvwa’;
$_DVWA[ ‘db_user’ ] = ‘dvwa_user’;
$_DVWA[ ‘db_password’ ] = ‘123456’;
$_DVWA[ 'db_port '] = ‘3306’;
配置完成后,点击创建数据库,进入登录页面:
在这里插入图片描述
–END–

发布了230 篇原创文章 · 获赞 29 · 访问量 23万+

猜你喜欢

转载自blog.csdn.net/huryer/article/details/101845124