I am trying to set up Damn Vulnerable Web App (DVWA) (www.dvwa.co.uk).
I installed XAMPP according to these instruction : http://www.apachefriends.org/en/xampp-windows.html I installed DVWA according to these instructions: http://www.youtube.com/watch?v=GzIj07jt8rM
I went to localhost/dvwa and see: Unable to connect to the database.
mysql_error()
I try to setup database, it shows "Could not connect to the database - please check the config file".
The /htdocs/dvwa/config/config.inc.php
file shows:
$_DVWA[ 'db_server' ] = 'localhost';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ] = 'root';
$_DVWA[ 'db_password' ] = 'p@ssw0rd';
I tried replacing localhost with 127.0.0.1
but it still did not work.
How I can fix this issue?
I had the same issue with it.
To Fix it
You must go to DVWA Directory>>Config>> Open config.inc.php with your favorite text editor.
then for $_DVWA[ 'db_password' ] = 'p@ssw0rd';
change the password to ''
and then it should be fixed.
On my windows-10 localhost after renaming config.inc.php.dist
to config.inc.php
and accessing the url http://localhost/dvwa/setup.php
I was seeing the error:
Unable to connect to the database.
Followed the steps:
Following Installing Damn Vulnerable Web Application (DVWA) on Windows 10 within config.inc.php
changed the password to blank
, effectively changed the line:
$_DVWA[ 'db_password' ] = 'p@ssw0rd';
to:
$_DVWA[ 'db_password' ] = '';
The issue still persisted as:
Could not connect to the database service.
Please check the config file.
Database Error #1045: Access denied for user 'dvwa'@'localhost' (using password: NO).
Changing the db_user
from dvwa
to root
solved the issue. So effectively you need to change the line:
$_DVWA[ 'db_user' ] = 'dvwa';
to:
$_DVWA[ 'db_user' ] = 'root';
Snapshot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With