If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mysql and perl

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-25-04, 08:17
vrao vrao is offline
Registered User
 
Join Date: Jul 2004
Posts: 1
mysql and perl

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:
#!/usr/bin/perl
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On