5

I've downloaded the most recent bWAPP from sourceforge.net and followed the INSTALL.txt guidelines to install it on a clean Kali Linux installation (2017.3).

I use the following MySQL connection settings:

// Database connection settings
$db_server = "localhost";
$db_username = "root";
$db_password = "";
$db_name = "bWAPP";

However, pressing the "Click here to install bWAPP." on http://localhost/bWAPP/install.php results in the following error message: "Connection failed: Access denied for user 'root'@'localhost'".

enter image description here

I've searched Google and it seems that other people have similar issue, but no solution is documented anywhere.

What am I doing wrong?

4 Answers 4

5

The reason is MariaDB database backend which comes installed with Kali Linux:

MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL.

This database backend doesn't allow root@localhost user access from applications.

I fixed the issue by creating a new database user, bwappu, with granted priviledges for the bwapp database:

GRANT ALL PRIVILEGES on bwapp.* to 'bwappu'@'localhost';

Also, see this post: https://stackoverflow.com/questions/28068155/access-denied-for-user-rootlocalhost-using-password-yes-after-new-instal

4

A little bit more detalization for correct answer by Nicolas Lykke Iversen:

Go to the terminal:

root@kali: mysql -u root -p
enter password 'toor'
MariaDB [(none)]> use mysql;
MariaDB[(mysql)]> create user 'username'@'localhost' identified by 'my_password';
MariaDB[(mysql)]> grant all privileges on bWAPP.* to 'username'@'localhost' identified by 'my_password';

Go to /var/www/html/bWAPP/admin/settings.php and set:

$db_username = "username";
$db_password = "my_password";

Then go to http://localhost/bWAPP/install.php and install it.

PS: username & my_password - you may use any words you like

1
  • When you say $db_password = "password";, do you mean literally $db_password = "password";, or do you mean $db_password = "ILoveSuperUser";, where the second password is replaced by the actual password you chose?  In other words, what parts of your answer are literal and what parts are placeholders?  Please do not respond in comments; edit your answer to make it clearer and more complete. Commented Jul 15, 2018 at 15:14
0

I had the same issue and figured out the solution for me at least. The $db_password field must be equal to the password for your SQL root user.

0

This solution worked for me on Kali Linux machine, but I am not sure if this is also applicable for ubuntu. Thank you.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .