[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug or newbie stupidity?



On Thu, Apr 27, 2006 at 10:03:08PM +0200, Francesco Cecconi wrote:

> This is a mysql connection example:
>  my $db_driver = "mysql";
>  my $db_name   = "test";
>  my $db_host   = "localhost";  --> for localhost mysql connection
>  
>  my $db_user   = "test";
>  my $db_passwd = "password"; 
> 
>  my $dbh = DBI->connect("DBI:$db_driver:$db_name:$db_host", $db_user, $db_passwd,
>                              { RaiseError => 1, AutoCommit => 0 });
> 

What is this example supposed to show?

Some tests:

1) I get - as expected (no mysql on localhost) - the following error message:

DBI connect('test:localhost','test',...) failed: Can't connect to
local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
at ./test line 12

2) If I point it against an existing mysql host I get no errors.

3) If I use a non existing database I get:

DBI connect('testXXX:guinan','gregoa',...) failed: Unknown database
'testXXX' at ./test line 12


gregor
 
-- 
 .''`.   http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4
 : :' :  infos zur usenet-hierarchie at.*: http://www.usenet.at/
 `. `'   member of https://www.vibe.at/ | how to reply: http://got.to/quote/
   `-    NP: Queen: The Show Must Go On

Attachment: signature.asc
Description: Digital signature


Reply to: