473,467 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC

8 New Member
I'm running OS X Snow Leopard on a MacBook Pro. I've installed Mysql using Macports. MySQL works fine, but I need to install the DBI module. I've tried several ways, but I always get the following error:

Expand|Select|Wrap|Line Numbers
  1. install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at (eval 3) line 3.
  2. Perhaps the DBD::mysql perl module hasn't been fully installed,
  3. or perhaps the capitalisation of 'mysql' isn't right.
  4. Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge.
  5.  at /Users/peterv/Perl1/db.pl line 7
  6.  
What I'd like to know is how to display what @INC contains, and how to set it to the correct values. I've searched everywhere I could think of and have found nothing. One guy suggested that @INC is a path (seems reasonable) that's not pointing to where the DBD/mysql.pm is. I really need to fix this, so any help debugging this will be really appreciated!
Apr 18 '10 #1
4 4713
numberwhun
3,509 Recognized Expert Moderator Specialist
Did you try writing some code that uses DBI? Last time I checked, DBI was a core module that was distributed with Perl. You should not have to install it.

@INC is the Perl specific path variable that contains a list of the path's that Perl looks for modules. This is set at installation/compilation and cannot be changed.

Regards,

Jeff
Apr 19 '10 #2
peterv6
8 New Member
Jeff,
Yes I did write a simple script using DBI, and it failed. I don't remember what the original error message was, since I've been installing & uninstalling things all weekend trying to get the thing to work. Currently, this is the error message I get:
Expand|Select|Wrap|Line Numbers
  1. peterv@MBP17.local<502>$: db.pl
  2. install_driver(mysql) failed: Can't locate loadable object for module DBD::mysql in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.10.1/darwin-multi-2level /opt/local/lib/perl5/site_perl/5.10.1 /opt/local/lib/perl5/site_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.10.1/darwin-multi-2level /opt/local/lib/perl5/vendor_perl/5.10.1 /opt/local/lib/perl5/vendor_perl /opt/local/lib/perl5/5.10.1/darwin-multi-2level /opt/local/lib/perl5/5.10.1 .) at (eval 3) line 3
  3. Compilation failed in require at (eval 3) line 3.
  4. Perhaps a module that DBD::mysql requires hasn't been fully installed
  5.  at /Users/peterv/Perl1/db.pl line 8
  6.  
  7. Mon Apr 19 08:32:26 EDT 2010 
  8.  
I installed the DBD module manually, according to the directions from CPAN, and, unfortunately, the Makefile.PL script they provide for installation has errors in it. I'm currently trying to debug that. I'm probably going to need help with it though, as I'm a novice perl programmer.
Apr 19 '10 #3
peterv6
8 New Member
Can anyone help me debug this output? I've followed all the installation instructions to the letter, and I'm still getting this error:
Expand|Select|Wrap|Line Numbers
  1. peterv@MBP17.local<506>$: sudo Perl Makefile.PL | tee makefile.log
  2. tee: makefile.log: Permission denied
  3.  
  4.  
  5. PLEASE NOTE:
  6.  
  7. For 'make test' to run properly, you must ensure that the 
  8. database user 'root' can connect to your MySQL server 
  9. and has the proper privileges that these tests require such 
  10. as 'drop table', 'create table', 'drop procedure', 'create procedure'
  11. as well as others. 
  12.  
  13. mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';
  14.  
  15. You can also optionally set the user to run 'make test' with:
  16.  
  17. perl Makefile.pl --testuser=username
  18.  
  19. Use of uninitialized value in printf at Makefile.PL line 175, <PIPE> line 102.
  20. I will use the following settings for compiling and testing:
  21.  
  22.   cflags        (mysql_config) = -I/opt/local/mysql/include  -g -Os -arch x86_64 -fno-common   -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT  -DDONT_DECLARE_CXA_PURE_VIRTUAL
  23.   embedded      (mysql_config) = 
  24.   libs          (mysql_config) = -L/opt/local/mysql/lib -lmysqlclient -lz -lm     -lmygcc
  25.   mysql_config  (guessed     ) = mysql_config
  26.   nocatchstderr (default     ) = 0
  27.   nofoundrows   (default     ) = 0
  28.   ssl           (guessed     ) = 0
  29.   testdb        (default     ) = test
  30.   testhost      (default     ) = 
  31.   testpassword  (default     ) = 
  32.   testsocket    (default     ) = 
  33.   testuser      (            ) = root
  34.  
  35. To change these settings, see 'perl Makefile.PL --help' and
  36. 'perldoc INSTALL'.
  37.  
  38. Multiple copies of Driver.xst found in: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/DBI/ at Makefile.PL line 748
  39. Using DBI 1.608 (for perl 5.010000 on darwin-thread-multi-2level) installed in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/
  40. Writing Makefile for DBD::mysql
  41.  
  42. Mon Apr 19 09:43:29 EDT 2010 
  43. /Library/Perl/DBD-mysql-4.011 ->
  44. peterv@MBP17.local<507>$: db.pl
  45. install_driver(mysql) failed: Can't locate loadable object for module DBD::mysql in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.10.1/darwin-multi-2level /opt/local/lib/perl5/site_perl/5.10.1 /opt/local/lib/perl5/site_perl/5.8.9 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.10.1/darwin-multi-2level /opt/local/lib/perl5/vendor_perl/5.10.1 /opt/local/lib/perl5/vendor_perl /opt/local/lib/perl5/5.10.1/darwin-multi-2level /opt/local/lib/perl5/5.10.1 .) at (eval 3) line 3
  46. Compilation failed in require at (eval 3) line 3.
  47. Perhaps a module that DBD::mysql requires hasn't been fully installed
  48.  at /Users/peterv/Perl1/db.pl line 8
  49.  
  50. Mon Apr 19 09:43:29 EDT 2010 
  51.  
Is there some better way to install this DBD module? is there ANY way to successfully install this thing? PLEASE I need help!
Apr 19 '10 #4
peterv6
8 New Member
@numberwhun
Jeff, I'm still having massive problems with this. No matter how I install the DBI module, it's never in the @INC path. You said that that path is set upon installation. Is it set in the Perl installation? If so, would uninstalling Perl and resinstalling it reset it? Also, what's the best way to remove perl from OS X? If all else fails, I'm about ready to do a clean reinstall of OS X and start from scratch.
Apr 20 '10 #5

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

Similar topics

4
by: Slant | last post by:
I have been using MySQL in conjunction with PHP for many years now... I have been using the exact same method for not only connecting to a database and performing the queries but also displaying...
0
by: john townsley | last post by:
I cant get mysql to run on my winXP computer. I have downloaded it and installed , unzipped and run setup.exe and placed it in c:\mysql. I type the command to start the mysql server...
1
by: Rich | last post by:
Hello, I need to change the font size of a datagridview to accommodate a screen resolution of 800x600. I know how to set the fontsize at runtime datagridview1.Font = New Font("arial", 8,...
5
by: HugoFromBOSS | last post by:
Hello, all this is starting to buy me the "make" compiler cant find "mysql.h" nor does "mysql.h" exisit on my system. I have tired searching for an answer on google but I cant understand any of them...
1
by: HugoFromBOSS | last post by:
Hey, I have compiled my application and it works fine connection to a MySQL database. When I move the application onto another computer It cant locate mySQL.h this is resolved by "yum install...
1
by: Bob | last post by:
Im setting up a fedora core 8 web server. Im currently running everything on another fedora core 6 server (working fine). Ive installed php 5.2.5 and apache 2.0.63 Im getting the following: ...
5
by: scorpionbilli | last post by:
Hi, The local mysql server is running on my Macbook. I can access it through the console client: $ mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL...
11
by: bthalapathi | last post by:
I have written a script to connect the mysql db #!/usr/bin/perl -w use DBI; #definition of variables $db="MYTEST"; $host="localhost"; $user="root"; $password="rootpass";
5
by: lisles | last post by:
i have a page funtion.php which hs the function to connect to the db /* Mysql Connection */ function connect(){ global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php...
0
Atli
by: Atli | last post by:
What to discuss: What is a "MySQL resource". What causes the error. How to fix it. Common Newbie Pitfalls This article is the second installment in a series of (hopefully) many, following...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.