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



# connect.pl - connect to the MySQL server

use strict;
use warnings;
use DBI;

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



Featured Links:
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