Having problem to connect to SQL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Having problem to connect to SQL

Postby r0x » 04. June 2009 06:13

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 :)
r0x
 
Posts: 3
Joined: 04. June 2009 06:02

Re: Having problem to connect to SQL

Postby Wiedmann » 04. June 2009 11:01

Access denied for user 'root'@'localhost' (using password: NO)

Your MySQL user "root" have a password, but you are using none for the connection.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Having problem to connect to SQL

Postby r0x » 05. June 2009 03:42

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.
r0x
 
Posts: 3
Joined: 04. June 2009 06:02

Re: Having problem to connect to SQL

Postby Wiedmann » 05. June 2009 09:43

where is the location of the password

It's stored in a system database.

I've tried to reset it a few times

How?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 37 guests