CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: DBI: Connecting MYSQL Database using Perl: Edit Log

New User

Feb 26, 2008, 1:38 AM

Views: 8871
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

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)~;


Can't locate in @INC (@INC contains: E:/Perl/lib E:/Perl/site/lib .) at line 2.
BEGIN failed--compilation aborted at 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)

Edit Log:
Post edited by Murali (New User) on Feb 26, 2008, 1:42 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives