0

Hello guys..

I am new to Perl and now reached till database concepts in Perl. I am using Wamp server in my computer. Is it possible to connect to the MySQL running in it :-/ ? But the Perl code is giving error while trying to connect to the SQL in it. The code i tried is below. The connection credentials are the same i use in my PhP in which it connects properly.

#!/usr/bin/perl
# PERL MODULES WE WILL BE USING
use DBI;
# CONFIG VARIABLES
$platform = "MySQL";
$database = "placement";
$host = "localhost";
$port = "8080";
$user = "root";
$pw = "";
#DATA SOURCE NAME
$dsn = "dbi:ODBC:$database:localhost:8080";
# PERL DBI CONNECT
$dbstore = DBI->connect($dsn, $user, $pw) or die "Unable to connect\n";
 print "Connected";

Iam using OPEN Perl IDE under Win7.
And it is giving the following error on compilation

DBI connect('placement:localhost:8080','root',...) failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (SQL-IM002) at noname.pl line 14
Unable to connect

Please provide little guidance.:icon_redface:

Edited by uvray90: n/a

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by d5e5
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.