Problems creating a DVWA database

I am trying to configure the Damn Vulnerable Web App (DVWA) (www.dvwa.co.uk).

I installed XAMPP according to this 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 saw: Unable to connect to the database.

mysql_error() 

I try to configure the database, it shows "Unable to connect to the database - check the configuration file."

The file /htdocs/dvwa/config/config.inc.php 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 didn't work.

How can I fix this problem?

+6
source share
7 answers

I had the same problem.

To fix it

You should go to the DVWA directory → Config → Open config.inc.php using your favorite text editor.

then for $_DVWA[ 'db_password' ] = ' p@ssw0rd '; change the password to '' and then it must be fixed.

+18
source

This error message appears in DVWA if mysql_connect() does not work. Possible reasons:

  • MySQL service is not running. Start the service:

     \xampp\mysql_start.bat 
  • The MySQL service runs on a non-standard port. If so, add the port to your hostname:

     $_DVWA['db_server'] = '127.0.0.1:3306'; // or whatever port you use 
  • The username or password is incorrect. Check them out in the XAMPP phpMyAdmin instance.

+5
source

Just remove the password from mysql configuration;

 **$_DVWA[ 'db_password' ] = '';** 

as if it would work fine.

+2
source

Open the file /htdocs/dvwa/config/config.inc.php in a text editor. Find the line $_DVWA[ 'db_port '] = '3306' and make sure port 3306 .

+2
source

you can also provide config.inc.php file for mysql server.

suppose my mysql password is 12345 , so I changed the config.inc.php file, for example

 $_DVWA[ 'db_server' ] = 'localhost'; $_DVWA[ 'db_database' ] = 'dvwa'; $_DVWA[ 'db_user' ] = 'root'; $_DVWA[ 'db_password' ] = '12345'; 
+1
source

I provided a detailed explanation on StackExchange. The link is as follows.

https://security.stackexchange.com/a/48125/36726

Quick fix:

  • Stop the XAMPP control panel.

  • Go to .. \ XAMPP \ mysql

  • Find resetroot.bat and execute it.

  • When prompted, enter a random key.

  • Restart the XAMPP control panel.

Now, when you try to connect to DVWA, the browser should land on the login page.

Good luck

0
source

To create a database using mysql , use:

 mysql -u root -p use mysql; create database dvwa; 
0
source

Source: https://habr.com/ru/post/959113/


All Articles