Home Scripting - All Others Connect to MySQL using Perl
Connect to MySQL using Perl PDF Print E-mail
Written by Siva   
Sunday, 21 November 2010 12:37

 

 

#!/usr/bin/perl
# connect.pl - connect to the MySQL server

use strict;
use warnings;
use DBI;

my $dsn = "DBI:mysql:host=localhost;database=mydatabase";
#@ _CONNECT_
my $dbh = DBI->connect ($dsn, "myuser", "mypass")
            or die "Cannot connect to server\n";
#@ _CONNECT_
print "Connected\n";
$dbh->disconnect ();
print "Disconnected\n";

 
 

Advertisement

Featured Links:
HREmail.com
Looking for job? Try HREmail.com
Want to have CMS based Websites?
Try siliconwebcreators.com to CMS based websites.
VM Solutions Inc
For best VM solutions..
Digital Procedure Inc.
Looking for Oracle /SAP /Weblogic Consulting services? visit digitalprocedure.com