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?


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

| improve this answer | |

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

| improve this answer | |
  • 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. – Scott Jul 15 '18 at 15:14

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.