473,698 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
+ 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 4739
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
1980
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 the results. I've been told numerous times that my methods are out-dated. I'm more than willing to cede to this possibility but I need help getting out of the rut!!! Can anyone help me? Here are some examples:
0
1325
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 c:\mysql\bin\mysqld --console It opens the console and then the console shows some inoDB commands and the console hangs. I followed the mysql manual and i cant find the answer there is no command prompt and nothing...how do I run mysql?
1
2404
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, FontStyle.Regular) But I would prefer to set this at the property sheet. The datasource for the datagridview is a dataview that I use for filtering.
5
2714
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 can somone post a quick how-to? # find / -name mysql.h # # mysql_config --cflags --libs -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE...
1
1371
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 mysql-devel" however, how do I include MySQL in my project without the need to install mysql-devel on each machine I run my app on. Thanks
1
3835
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: Warning: include_once() : Failed opening 'mysql.inc' for inclusion (include_path='/home/jeff/src/soccer/php_inc') in /home/ http/soc/show.php on line 13
5
2628
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 connection id is 4 Server version: 5.0.45 MySQL Community Server (GPL)
11
6179
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
9131
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 $conn = @mysql_connect($db_server,$db_user,$db_pass) or die("Connection to Database Server Failed"); @mysql_select_db($db) or die("Database Selection Failed"); return $conn; }
0
5615
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 Markus' first installment: 1: Headers Already Sent.
0
8683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5862
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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 we have to send another system

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.