Feb 26, 2008, 1:38 AM
Post #1 of 6
Connecting MYSQL Database using Perl
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
## 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)~;
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
(This post was edited by Murali on Feb 26, 2008, 1:42 AM)