搭建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’;
配置完成后,点击创建数据库,进入登录页面:
搭建DVWA环境异常,Php7.3.9连接mysql8_第1张图片
–END–

你可能感兴趣的:(security)