CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Data Base connectivity Problem

 



rockowtham
New User

Dec 22, 2010, 1:29 AM

Post #1 of 1 (259 views)
Data Base connectivity Problem Can't Post

Hii..,

I am new to perl and and hardly coded my first program with database connectivity , i got the error as

DBI connect('database=cricruns','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /home/gowtham/Desktop/sample.pl line 11
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /home/gowtham/Desktop/sample.pl line 11

This is my program

#!/usr/bin/perl

use DBI;
use strict;

my $driver = "mysql";
my $database = "cricruns";
my $dsn = "DBI:$driver:database=$database";
my $userid = "root";
my $password =" ";
my $dbh = DBI->connect($dsn, $userid, $password )
or die $DBI::errstr;
Please anybody help me .

Thanks in advance

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives