List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 26 2000 8:12pm
Subject:Re: DBI remote connection to MySQL?
View as plain text  
At 3:49 PM -0700 04-25-2000, Kirk Rogers wrote:
>Is there a reason why I can't connect to MySQL with the following:
>
>
>...
>...
>7)  my $dbh = DBI->connect("DBI:mysql:database=db;host=myhost.com", undef,
>undef, {RaiseError => 1} );
>...
>...
>
>my.cnf file:
>
>...
>...
># This will be passed to all mysql clients
>[client]
>#password=my_password
>port=3306
>#socket=MySQL
>
># Here is entries for some specific programs
># The following values assume you have at least 32M ram
>...
>...
>
>I keep getting:
>
>E:\Perl\progs>test_mysql.pl
>DBI->connect failed: Access denied for user: '@KROGERS' to database 'pcc' at
>E:\Perl\progs\test_mysql.pl line 7



The my.cnf file won't be used unless you tell DBI to use it.  You
might try changing:

"DBI:mysql:database=db;host=myhost.com"

to:

"DBI:mysql:database=db;host=myhost.com;mysql_read_default_file=/path/to/my.cnf"

-- 
Paul DuBois, paul@stripped
Thread
DBI remote connection to MySQL?Kirk Rogers26 Apr
  • Re: DBI remote connection to MySQL?Thimble Smith26 Apr
  • Re: DBI remote connection to MySQL?Paul DuBois27 Apr