
Murali
New User
Feb 26, 2008, 1:38 AM
Post #1 of 6
(13586 views)
|
Connecting MYSQL Database using Perl
|
Can't Post
|
|
Hi, I have installed Perl 5 to my Windows, But when try to connect the mysql database using the perl script, it is throwing some error. Here is my code Use Mysql; ## connect to mySQL database: $DBHOST = "localhost"; $DBNAME = "mydatabase"; $DBUSER = "root"; $DBPASS = "passwd"; $DB = Mysql->connect($DBHOST, $DBNAME, $DBUSER, $DBPASS); ## Query to the database: $SQuery = qq~CREATE TABLE member(member_id INTEGER NOT NULL,member_name VARCHAR(100),member_status TINYINT DEFAULT 1 NOT NULL)~; Error: E:\Perl>perl dbtest.pl Can't locate Mysql.pm in @INC (@INC contains: E:/Perl/lib E:/Perl/site/lib .) at dbtest.pl line 2. BEGIN failed--compilation aborted at dbtest.pl line 2. Can some one clarify this?. Whether I need to add MYSQL Connectors to any specified path of the Perl Installed directory? Some one provide me a simple example for executing a simple query using perl with mysql on windows -Murali
(This post was edited by Murali on Feb 26, 2008, 1:42 AM)
|