Re: dbi connecting prob ->

2001-05-15 Thread Bodo Eing

From:   "vortex" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject:dbi connecting prob ->
Date sent:  Mon, 14 May 2001 09:30:01 -0700


vortex,

> Why will this code not let me connect to a server
> 
> use DBI; my $dsn = 'DBI:mysql:my_database:localhost';

Try :

my $dsn = 'dbi:mysql:database=my_database';
#^
my $db_user_name = 'admin'; 
my $db_password = 'secret';  
my $dbh = DBI->connect($dsn, $db_user_name, $db_password) or die 
DBI::errstr();  # add error checking

> 
> 
> it just gives me an error, it won't let me connect
> 

HTH

Bodo
[EMAIL PROTECTED]
Dr. med. Bodo Eing
Institut fuer Medizinische Mikrobiologie
Klinische Virologie
v.-Stauffenbergstr. 36
48151 Muenster
Germany

Phone: ++49 251 7793 111 Fax: ++49 251 7793-104



RE: dbi connecting prob ->

2001-05-14 Thread Neil Lunn


Well you did't say what the error was. Try this and at least you should get
an error that tells  you something about why connect is failing.

use DBI; my $dsn = 'DBI:mysql:my_database:localhost';
my $db_user_name = 'admin';
my $db_password = 'secret';
my $dbh = DBI->connect($dsn, $db_user_name, $db_password, {RaiseError =>1});

Neil

> -Original Message-
> From: vortex [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 15, 2001 2:30 AM
> To: [EMAIL PROTECTED]
> Subject: dbi connecting prob ->
> 
> 
> Why will this code not let me connect to a server
> 
> use DBI; my $dsn = 'DBI:mysql:my_database:localhost'; my 
> $db_user_name = 'admin'; my $db_password = 'secret'; my ($id, 
> $password); my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
> 
> 
> it just gives me an error, it won't let me connect
> 

__
Please Note :
Only  the intended recipient is authorised to access or use this e-mail.  If
you are not the intended recipient,
please delete this e-mail and notify the sender immediately.   The contents
of this e-mail are the writer's 
opinion and are not necessarily endorsed by the Gunz Companies unless
expressly stated.

We use virus scanning software but exclude all liability for viruses or
similar in any attachment.