Well I solved it, at first I had mutillidae installed which used myslq, then I installed dvwa which uses mariadb, so I don't know if I'm fine but when installing mariadb(versions 10.6 or higher) it dumps the mysql database, so it got misconfigured or something like that, so I did the following:
If you have a password in mysql, put this (in my case it was 'mutillidae'):
mysql -u root -p{ your root password here}
Otherwise just with it:
sudo mysql;
and the following is this:
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password;
FLUSH PRIVILEGES;
exit
At least that's what I did, but before I didn't have a database called 'mutillidae', only the one of 'dvwa', so I created a database with the name of mutillidae.
In my 'database-config.inc'
file located in the path /var/www/html/mutillidae/includes
, I have the following:
<?php
define('DB_HOST', '127.0.0.1');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_NAME', 'mutillidae');
define('DB_PORT', 3306);
?>
In my DVWA 'config.inc.php'
file located at the path /var/www/html/DVWA/config
, I have the following:
$_DVWA = array();
$_DVWA[ 'db_server' ] = '127.0.0.1';
$_DVWA[ 'db_database' ] = 'dvwa';
$_DVWA[ 'db_user' ] = 'dvwa';
$_DVWA[ 'db_password' ] = 'p@ssw0rd';
$_DVWA[ 'db_port'] = '3306';