I am using Easy php

i am trying to connect with the following code

$con = mysql_connect("localhost","admin","");
if (!$con)
  die('Could not connect: ' . mysql_error());

// some code

getting error as follows

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'admin'@'localhost' (using password: NO) in C:\Program Files\EasyPHP 2.0b1\www\test1.php on line 2
Could not connect: Access denied for user 'admin'@'localhost' (using password: NO)

Apparantly you need to provide a password to connect to mysql. It is missing on line 2.

yes i got it through the admin page ..i used "root" instead of "admin"

Yes root without password will work. Please mark it as solved if solved.

the username should be root if you use the default

a question..how to set the password

you can update the password also...

run this query in database 'mysql'->table 'user'

update user set Password = md5('12345') where user = "root";

above query update the user 'root' with password '12345'