newbie question: using DBI, DBI::mysql
From: sstark_at_nospam.com ((sstark_at_nospam.com))
Date: 10/20/03
- Previous message: Jaques: "Re: Namespace Win32::File::CompVer"
- Next in thread: Andrew Shitov: "Re: newbie question: using DBI, DBI::mysql"
- Reply: Andrew Shitov: "Re: newbie question: using DBI, DBI::mysql"
- Reply: cp: "Re: newbie question: using DBI, DBI::mysql"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 20 Oct 2003 03:38:54 GMT
Hi, I'm trying to get started using DBI and DBD::mysql to connect to an mysql database (of which I am the owner). When I run:
##################
#! /usr/bin/perl
use strict;
use DBI;
use DBD::mysql;
# get variables...
my $dbh=DBI->connect(
'DBI:mysql:$database',
$user,
$password
) or die "\nError:\nCould not connect;\n"
. $DBI::errstr . ";\nstopped";
#######################
I get this error:
DBI->connect($database) failed: Can't connect to local MySQL server through sock
et '/tmp/mysql.sock' (2) at ./m.pl line 15
Error:
Could not connect;
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2);
stopped at ./m.pl line 15.
Anything obvious about what I'm doing wrong here? Sorry if this is a dumb question.
thanks
Scott Stark
sstark@hi-beam.net
- Previous message: Jaques: "Re: Namespace Win32::File::CompVer"
- Next in thread: Andrew Shitov: "Re: newbie question: using DBI, DBI::mysql"
- Reply: Andrew Shitov: "Re: newbie question: using DBI, DBI::mysql"
- Reply: cp: "Re: newbie question: using DBI, DBI::mysql"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]