Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Install MySQL and DBD::MySQL on Mac OS X
07-16-2010, 12:18 PM
Post: #11
RE: Install MySQL and DBD::MySQL on Mac OS X
(05-04-2010 12:54 PM)Kwok Wrote:  
(05-03-2010 11:55 PM)dhoen Wrote:  Any news on installing on Snow Leopard? I am currently trying to do this... and starting to pull out my hair! Thanks in advance for any help.

I install mine on a Intel Core 2 Duo Machine running OS 10.6.2. I use mysql-5.1.43-osx10.6-x86_64 binary.

Before installing DBD::MySQL, I set up my environment by:
PATH=$PATH:/usr/local/mysql/bin

You might have to change this if mysql installed in different directory.
You also need to set up your user name and password for mysql

Then:
$ perl -MCPAN -e 'shell'

cpan[1]> get DBD::mysql

cpan[2]> exit

$ cd ~/.cpan/build/DBD-mysql-4.013-cB623q/

$ perl Makefile.PL --testuser='mysql_user_name' --testpassword='mysql_passwd'

$ make

$ make test

It should say all test successful.

Finally:
$ sudo make install

Hope this helpful.

Kwok

I had most of the problems mentioned in this thread too and eventually had success. Thank you all very much.

I'm using a new Macbook Pro 13-inch, with Snow Leopard and the Xcode from the Apple Website. 4GB Ram, 500GB Fujitsu drive. Apache 2.2.

The new Snow Leopard apparently uses the 64-bit Perl, as I tried installing the MySQL 32-bit package first and had the trouble with the DBD::mysql installation as mentioned by others (above).

I also had the PATH problem, which prevented the secure installation. Setting the $PATH to use the /usr/local/mysql/bin. By the way, there is a file /private/etc/paths that you can edit to do this. Once that was done, I was able to complete the mysql_secure_installation, create a non-root user, create a my.cnf from the my-large.cnf file, then follow the above instruction.

I have pasted a ... simple shell script that makes it easy to remove all the mysql, including the preference pane (other) ... so you can start over again, with the 64-bit mysql; or with the 32-bit mysql (if that matches your Perl / word size).

Thanks again for all of your help and suggestions from everyone.

------- code ----------
#!/bin/bash

locations="
/usr/local/mysql
/usr/local/mysql*
/Library/StartupItems/MySQLCOM
/Library/PreferencePanes/My*
/Users/ernest/Library/PreferencePanes/My*
/Library/Receipts/mysql*
/Library/Receipts/MySQL*
/var/db/receipts/com.mysql.*
"

for i in $locations
do
rm -rf $i
done

if [ `grep "MYSQLCOM" /etc/hostconfig` ]; then
echo "You also need to edit the /etc/hostconfig file"
else
echo "You do not need to edit the /etc/hostconfig file"
fi
exit 0

-------- end code --------
Quote this message in a reply
09-29-2010, 08:21 AM
Post: #12
RE: Install MySQL and DBD::MySQL on Mac OS X
i am unable to install mysql on older version of Mac ....i have tried many times but i am fail...please suggest me
Quote this message in a reply
01-27-2011, 08:39 PM
Post: #13
RE: Install MySQL and DBD::MySQL on Mac OS X
I just upgraded to an i7 computer running 10.6.6 and am starting to lose faith I can get DBD::MySQL working. I still have the 64-bit version of Perl (v5.10.0) that came with the OS based on the instructions Kwok wrote in the comments. I need DBD::MySQL for my job and I'm racing around trying to find a solution.

With a fresh copy of Snow Leopard, I downloaded and installed a 64-bit version of MySQL (mysql-5.5.8-osx10.6-x86_64). The install went smoothly, here's my setup. I was able to setup my root user and setup my environment successfully with the PATH variable.

I downloaded and installed DBI and then created a Makefile.PL for DBD::MySQL. I ran into a wall when I tried to run make test:

Code:
t/00base....................NOK 2/6#     Tried to use 'DBD::mysql'.          
#     Error:  Can't load '/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.16.dylib
#   Referenced from: /Users/swm/.cpan/build/DBD-mysql-4.018-Pnd2qz/blib/arch/auto/DBD/mysql/mysql.bundle
#   Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207.
#  at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9

I'm at a loss for what to do next. I've tried multiple searches, scoured forums and I'm hopeful someone can point me in the right direction. Thanks in advance.
Find all posts by this user
Quote this message in a reply
02-28-2011, 04:46 PM
Post: #14
RE: Install MySQL and DBD::MySQL on Mac OS X
(01-27-2011 08:39 PM)scottmccracken Wrote:  I'm at a loss for what to do next. I've tried multiple searches, scoured forums and I'm hopeful someone can point me in the right direction. Thanks in advance.

Hi Scott,

I ran into the same error as you, after following all the same steps. I noticed that the error message said it couldn't find libmysqlclient.16.dylib, but this file did exist in /usr/local/lib/mysql. So what I did was

Code:
cd /usr/local/lib
sudo ln -s /usr/local/mysql/lib/*.dylib .

and then it worked. Probably adding /usr/local/mysql/lib to LIBRARY_LD_PATH would accomplish the same thing. Hope this helps!
Quote this message in a reply
03-04-2011, 04:37 PM
Post: #15
RE: Install MySQL and DBD::MySQL on Mac OS X
XboxFan: I was having the same problem, and your soft link solution worked perfectly. You are legendary.
Quote this message in a reply
05-05-2011, 10:45 PM
Post: #16
RE: Install MySQL and DBD::MySQL on Mac OS X
(02-28-2011 04:46 PM)XboxFan Wrote:  
(01-27-2011 08:39 PM)scottmccracken Wrote:  I'm at a loss for what to do next. I've tried multiple searches, scoured forums and I'm hopeful someone can point me in the right direction. Thanks in advance.

Hi Scott,

I ran into the same error as you, after following all the same steps. I noticed that the error message said it couldn't find libmysqlclient.16.dylib, but this file did exist in /usr/local/lib/mysql. So what I did was

Code:
cd /usr/local/lib
sudo ln -s /usr/local/mysql/lib/*.dylib .

and then it worked. Probably adding /usr/local/mysql/lib to LIBRARY_LD_PATH would accomplish the same thing. Hope this helps!

Hi XBoxFan!

You are a star, thanks so much for the hint!! Just spent an hour trying to figure out what was wrong with no luck, and now it all works perfectly after those symbolic links were created.

Cheers,
Lev
Quote this message in a reply
06-22-2011, 04:22 AM
Post: #17
RE: Install MySQL and DBD::MySQL on Mac OS X
I tried running the simple_gene_query.pl script from a webpage (using localhost) and received the following error:

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 /Library/WebServer/CGI-Executables/simple_gene_query.pl line 11.
BEGIN failed--compilation aborted at /Library/WebServer/CGI-Executables/simple_gene_query.pl line 11.

I looked into it, and some other people were having similar issues, but I couldn't find an exact answer. There are a couple things that come to mind, but not sure how to go about fixing them:

1. The mysql pm is located in a directory outside of the "core" library modules, which i expect since I built and installed the mysql modules from external sources. The mysql pm is located at: /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/DBD. Notice that it is located at a directory called "site_perl" and not the core directory.
2. The versions don't quite line up, as the error message claims that the module files should be associated with Perl 5.10. I could upgrade, but didn't want to make matters worse if I did. Should I upgrade? (Actually, according to perl.org, the latest version is 5.14). If this is the issue, how in the world did this happen? How do I get Perl to point to the correct version of the mysql module?
3. This didn't seem to change anything, but the script was written as "use DBD::MySql" but the installed modules are "mysql" (i.e., case sensitivity issues) Am I missing something here?

Thanks for any help.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 4 Guest(s)