I am using Windows XP. I can connect to the default MySQL "test" database from command prompt, without giving any password or username. The username and password are already set and I can see it from the WinMySqlAdmin Console.

But from perl, when I give the username password, it refuses connection.
I get connection error: DBI Connect

DBI connect('database=test;host=blore:','root',...) failed: Host 'blore' is not allowed to connect to this MySQL server.

In this case my hsot is "blore". Even when I use my host’s IP address instead of hostname ‘blore’ I get same error.

Here is the source perl code:
use DBI;
use strict;
my $hostname = "blore";
my $username = "root";
my $password = "mysql";
my $database = "test";
my $dsn = "DBI:mysql:database=$database;host=$hostname:" ;
my $dbh = DBI->connect($dsn, $username,$password);

Can you tell me what I am doing wrong.