Database Error #1045: Access denied for user 'notdvwa'@'localhost' (using password: YES).
This error means the username or password in the config file do not match those configured on the database.The error is telling you that you are using the username notdvwa.Video Help
1. Double check the config fileVerify what you think you put in the config file is what is actually there.2. Test database login from command lineAssuming you have a database user of dvwa and a password of p@ssw0rd, run:
mysql -u dvwa -pp@ssw0rd -D dvwa
There is no space after the -p
3. Interpret the resultsIf successful, you’ll see:
Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 14Server version: 10.3.22-MariaDB-0ubuntu0.19.10.1 Ubuntu 19.10Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [dvwa]>
As you can connect on the command line, it is likely something wrong in the config file. Double check that and then raise an issue if you still can’t get things working.If you see this error:
ERROR 1045 (28000): Access denied for user 'dvwa'@'localhost' (using password: YES)
The username or password you are using is wrong. Repeat the Database Setup steps and make sure you use the same username and password throughout the process.
SQL: Access denied for user 'dvwa'@'localhost' to database 'notdvwa'
This error says you have pointed the config file at the wrong database. It is saying that you are using the user dvwa and trying to connect to the database notdvwa.Video Help
Option 1: Switch to MariaDB (Recommended)The easiest solution is to uninstall MySQL and install MariaDB. Follow the official guide from the MariaDB project:How to Migrate from MySQL to MariaDBOption 2: Configure MySQL Native PasswordStep 1: As root, edit the file /etc/mysql/mysql.conf.d/mysqld.cnfStep 2: Under the line [mysqld], add:
There are a few reasons you could be getting these errors, but the most likely is the version of database server you are running is not compatible with the version of PHP.This is most commonly found when you are running the latest version of MySQL as PHP and it do not get on well.
The site will work with MySQL instead of MariaDB but we strongly recommend MariaDB as it works out of the box whereas you have to make changes to get MySQL to work correctly.
If you are using MariaDB rather than MySQL (MariaDB is default in Kali), then you can’t use the database root user. You must create a new database user.To do this, connect to the database as the root user then use the following commands:
MariaDB [(none)]> create database dvwa;Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> create user dvwa@localhost identified by 'p@ssw0rd';Query OK, 0 rows affected (0.01 sec)MariaDB [(none)]> grant all on dvwa.* to dvwa@localhost;Query OK, 0 rows affected (0.01 sec)MariaDB [(none)]> flush privileges;Query OK, 0 rows affected (0.00 sec)