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

Reply via email to