473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Need help, installing mysql in Perl v5.10.0

I have written a script to connect the mysql db

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl  -w
  2.  
  3. use DBI;
  4. #definition of variables
  5. $db="MYTEST";
  6. $host="localhost";
  7. $user="root";
  8. $password="rootpass";
  9.  
  10. #connect to MySQL database
  11. my $dbh   = DBI->connect ("DBI:mysql:database=$db:host=$host:3366",$user,$password)
  12.                           or die "Can't connect to database: $DBI::errstr\n";
as specified mysql port is 3366 not 3306

but this returns with error,

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .
) at (eval 4) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: CSV, DBM, ExampleP, File, Gofer, ODBC, Oracle, Proxy, SQLite, Sponge.
at sample.pl line 11

But I already installed DBD::mysql

C:\Documents and Settings\Administrator>ppm install DBD::mysql
Downloading ActiveState Package Repository packlist...not modified
No missing packages to install

C:\Documents and Settings\Administrator>ppm verify DBD::mysql
ppm verify failed: Package 'DBD::mysql' is not installed

C:\Documents and Settings\Administrator>

I'm using perl version, 5.10.0 built for MSWin32-x86-multi-thread

Any help will be appreciated, Thanks in advanced for all your help
Sep 23 '08 #1
11 6130
KevinADC
4,059 Expert 2GB
It appears your install DBD::mysql was not successful. Look in the DBD folder in the perl/lib or perl/site/lib folder and see if it is there.
Sep 23 '08 #2
Thanks for your reply.

Yes, the DBD:mysql is not installed successfully. The mysql.pm is not available either in C:\Perl\lib\DBD or C:\Perl\site\lib\DBD

Through google I find that we have to execute 'ppm install DBD:mysql' in the command prompt to install DBD:mysql. But this is not helpful for me for some reason.

I don't know the way to install DBD:mysql successfully. Is there any alternative way to install the DBD:mysql? Please help me to install DBD:mysql in my v5.10 Perl.

Thanks in Advance for all your help.
Sep 24 '08 #3
KevinADC
4,059 Expert 2GB
Try this:

START>>PROGRAMS>>ACTIVEPERL>>PPM

Once thePPM GUI is running click on the EDIT tab, then PREFERENCES, then click on the REPOSITORIES tab then on the SUGGESTED tab select "uwinnipeg" and click on ADD. After the uwinnipeg packages are viewable see if DBD-mysql is listed. If not try the same thing and add "bribes" to the list of repositories. Once the DBD-mysql module is listed mark it for install then install it. Read the PPM help files if my instructions are confusing.
Sep 24 '08 #4
Finally it is working, ofcourse following your instructions. Lot of thanks KevinADC.

I followed the below

Start -> Run -> PPM , this opens the PPM GUI and

Edit -> Preferences -> Repositories -> Add Repository

First I selected 'uwinnipeg' it was not listed the DBD:mysql then I selected 'bribes' and this too not helped but selecting 'trouchelle' finally listed DBD:mysql which helped me to continue.

After selecting 'trouchelle', I pressed CTRL+1 and found DBD-mysql. Then right click on DBD-mysql and chosen 'Install DBD-mysql XX +'. Went to menu File > Run Marked Actions. Done.

Then I ran the script I mentioned in my first post, it works like a charm.

Again thanks for all your help.

thala
Sep 24 '08 #5
KevinADC
4,059 Expert 2GB
You're welcome
Sep 24 '08 #6
@bthalapathi
It's very clear,but why I don't have "Add Repository"?and"uwinnipeg","trouchelle'"?


I have the same problem Orz...and I can't solve it.
can you help me? thanks a lot ^^
Dec 6 '08 #7
KevinADC
4,059 Expert 2GB
Can't you click on the "Suggested" box and see a list of repository names?
Dec 6 '08 #8
@KevinADC
I can't see any list of of repository names.
I used CPAN(by CMD) and PPM(By CMD and PPM console) to instal DBD::Mysql,but still "ppm verify failed: Package 'DBD::mysql'"
Dec 7 '08 #9
KevinADC
4,059 Expert 2GB
try adding a repository using the PPM GUI:

http://theoryx5.uwinnipeg.ca/ppms/
http://www.bribes.org/perl/ppm
http://trouchelle.com/ppm/
Dec 7 '08 #10
@KevinADC
ha I solve the problem!but now I have another problem
"DBD::mysql" object version 4.005 does not match bootstrap parameter 4.010 at c:/perl/lib/DynalLoader.pm
the above problem I will try to solve it.
Thanks for your help! ^^"
Dec 7 '08 #11
KevinADC
4,059 Expert 2GB
Looks like you need to install a higher version of DBD::mysql
Dec 9 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Angus Comber | last post by:
I have set a password for the mysql root user so when I do this: shell> perl -MCPAN -e shell cpan> install DBI cpan> install DBD::mysql install DBD::mysql fails Is there a way I can run...
175
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
0
by: vishalp79 | last post by:
Hi, I am trying to install DBD::Informix module on perl on hpux 11.23 machine. but i get this weird error ...... Set up gcc environment - 4.1.1 *** ExtUtils::AutoInstall version 0.61 ***...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
12
by: jcor | last post by:
Hi, I'm using Ubuntu 7.04. I'm writing a sript that sends files via ftp for several destinations. So far I used Net::FTP and it worked fine. My problem is that I need to send files via SFTP...
1
by: Megi | last post by:
welcome, I input data form file to mysql with command: load data local infile.. The efect is that the data are duplicated or trippled..etc with every re-loading the script, but I need to load...
1
by: spatro | last post by:
Hi, I am trying to install DBD::mysql using the CPAN and I am facing the following error: cpan> install DBD::mysql CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Warning:...
0
by: Scotsman | last post by:
Hi All I have a sticky problem! Its a LEFT JOIN sql statement which works fine in MySQL but not when called in Perl. Any ideas? I have 2 tables: campaigns & companies. I'm trying to join them...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.