Page 1 of 1

Having problem to connect to SQL

PostPosted: 04. June 2009 06:13
by r0x
Hi,

I'm having a problem to connect to the SQL. The error message is..
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampplite\htdocs\dvwa\includes\config.php on line 11

Access denied for user ''@'localhost' to database 'dvwa'


Here is config.php file... looks like root without password.. (i'm new sql user... just play around with it today)
<?

$user="root";
$password="";

#
# Do not edit below this line.
#

$database="dvwa";
mysql_connect(localhost,$user,$password);

?>

Any idea what should I do. I've tried to setup password for it, but failed.

C:\xampplite\mysql\bin>mysql.exe -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Any advice in this matter would be most appreciated. Thanks guys :)

Re: Having problem to connect to SQL

PostPosted: 04. June 2009 11:01
by Wiedmann
Access denied for user 'root'@'localhost' (using password: NO)

Your MySQL user "root" have a password, but you are using none for the connection.

Re: Having problem to connect to SQL

PostPosted: 05. June 2009 03:42
by r0x
Thanks Wiedmann for your prompt reply. May I know where is the location of the password. I've tried to reset it a few times but still cannot connect to the database.

I thought the user name is root without password based on this linen on config.php...

$user="root";
$password="";


This is the project that I'm trying now..
http://sourceforge.net/projects/dvwa

Here is another error when I try to connect to http://localhost/phpmyadmin/

Error

MySQL said: Documentation
Cannot connect: invalid settings.

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

Re: Having problem to connect to SQL

PostPosted: 05. June 2009 09:43
by Wiedmann
where is the location of the password

It's stored in a system database.

I've tried to reset it a few times

How?