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