Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with creation of database DVWA

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?

like image 450
Fatima Avatar asked Dec 01 '13 08:12

Fatima


2 Answers

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.

like image 54
Akar Avatar answered Oct 03 '22 04:10

Akar


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).

Solution

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:

DVWA

like image 29
undetected Selenium Avatar answered Oct 03 '22 04:10

undetected Selenium