|
Install DBD::MySQL on Mac OS X Snow Leopard
|
|
01-29-2011, 10:52 AM
(This post was last modified: 04-08-2012 11:01 AM by Daz.)
Post: #1
|
|||
|
|||
|
Install DBD::MySQL on Mac OS X Snow Leopard
The best way to manage software dependencies on Mac OS X Snow Leopard (10.6.x) now - in my opinion - is to use homebrew as it takes care of all dependency management for you and also allows an easy upgrade path on libraries and tools. Another bonus is that as it installs everything from source code, compiling perl modules and the like against things installed via homebrew is very simple.
If you've been previously using MacPorts, follow the instructions here, to remove it before continuing. If you've already got an install of MySQL (binary install - not from macports), you must also remove that before continung. Make sure MySQL is shut down, then follow the instructions here and then here before continuing. Note: If you're not on Snow Leopard, you CANNOT use homebrew - it's Snow Leopard only. --- Homebrew --- To install homebrew, simply make sure you have Xcode installed and follow the instructions the homebrew homepage. But if you can't be bothered to read that, simply run the following command: Code: ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"This will set-up and install homebrew for you. (Note: it may not work the first time for you due to permissions settings - just run the command that the script tells you to, then run the installer again). --- MySQL --- That's homebrew done, now to install MySQL... Code: brew install mysqlThis will take a while to download and compile all of the packages, but wasn't that easy? Once that's done, let's get MySQL set up: Code: mysql_install_dbAnd now fire it up: Code: mysql.server startIf you get problems with the above command you can try the 'mysqld_safe' script - this will automatically start mysql and keep it running for you. NOTE: If you want MySQL to automatically start at login, type this: Code: launchctl load -w /usr/local/Cellar/mysql/5.1.43/com.mysql.mysqld.plist--- DBD::mysql --- First, let's set up a user account for DBD::mysql to run its test suite with. Log into MySQL as the root user: Code: mysql -u rootThen at the MySQL prompt, create a user with your currently logged in username, mine in this case is 'daz': Code: grant all privileges on *.* to 'daz'@'localhost';That's our user set up, now to use CPANPLUS (the newer, better alternative to just plain old CPAN) to install our modules: Code: sudo cpanpThis will launch the CPANPLUS shell, now first a quick setup option: Code: s conf prereqs 1; s saveThis will tell CPANPLUS to automatically install dependencies (instead of constantly asking you). Now to install our modules: Code: i DBIThis will install both DBI and DBD::mysql, if the tests pass and the modules install ok, you're now good to go! ![]() To exit the CPANPLUS shell: Code: q--- Final Cleanup --- We've currently got a fairly insecure MySQL instance running on our Mac now, if you want to tighten things up, i'd do the following: Remove our testing MySQL user account, replace it with a real one (first log into mysql: 'mysql -u root'): Code: revoke all privileges on *.* from 'daz'@'localhost';Now, put a password on the root MySQL user account: Code: mysqladmin -u root password NEW_ROOT_PASSWORDAnd we're done. |
|||
|
08-16-2011, 08:55 AM
(This post was last modified: 10-20-2011 08:21 PM by Daz.)
Post: #2
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
thanks
|
|||
|
09-23-2011, 08:37 AM
(This post was last modified: 09-23-2011 09:02 AM by shinsan.)
Post: #3
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
Hi Daz
My operating system is : Mac OSX Snow Leopard 10.6.8 I've been trying to install DBD-mysql for last 2 days however I did manage to install it but when I tried using it I got this error Code: dyld: lazy symbol binding failed: Symbol not found: _mysql_initSo then I stumbled across this thread and decieded to try your method, I follow your instruction and I manage to get to the mysql installation part, but it seem to always fail for me, here's my a out put: Code: comp:~ flyn$ brew install -v mysql |
|||
|
09-24-2011, 07:09 AM
Post: #4
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
Hmmm, that looks like homebrew is having real issues installing MySQL...
I'm afraid that's a little beyond me - I'd suggest following the instructions on the checklist here: https://github.com/mxcl/homebrew/wiki/ch...-new-issue And if that fails to install MySQL cleanly, follow the rest of the info on the rest of the page to file an issue with the homebrew folk - generally they're nice folk to talk to. Hope you get somewhere with it!
|
|||
|
10-13-2011, 04:05 PM
(This post was last modified: 10-20-2011 08:21 PM by Daz.)
Post: #5
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
First, I wanted to thank you for taking the time to write this post. It was a savior for me once before and I'm hoping it can be again.
DBD:MySQL on OS X Lion: I needed to upgrade my computers to OS X Lion recently. To play it "safe" I decided to start by upgrading my laptop, leaving my iMac alone, because my job requires DBD:MySQL be functioning properly and I wanted at least one working computer. I'm thankful I did because I'm getting new errors with DBD:MySQL on Lion (sigh). Here's the error message I get: Quote:install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at (eval 21) line 3. Lion apparently comes with a new version of Perl (5.12). I was previously using 5.10 with Snow Leopard, so that's where the DBD was installed. Do I have to install a new version of DBD::MySQL? Can I do that without creating an error with the existing version? Here are my system paths: Quote:# perl -V So @INC is looking at Perl v5.1.2. What's odd is when I searched for DBD on my computer this came up: Quote:# find / -name DBD -print I tried adding use lib("/System/Library/Perl/Extras/5.10/darwin-thread-multi-2level"); to my Perl script, but it still didn't work (same error). I've verified MySQL is running. There's something I'm missing and it's making my head spin. Any help would be much appreciated. Thanks, Scott |
|||
|
10-20-2011, 08:19 PM
Post: #6
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
Hi Scott,
Sorry for the slow response, I hadn't meant to take this long to reply. ![]() I haven't had a chance to test this on my system yet (and may not get a chance for a few days as i'm off on holiday tomorrow), but from what i've read regarding upgrading to Lion and Perl, all you should need to do is simply re-install the modules you need. This is quite normal with OS X upgrades as system libraries tend to get moved around/updated between releases. Simply fire up cpan plus and try re-installing... Code: sudo cpanpthen: Code: i DBILet me know how you get on - if you're still having trouble i'll have a proper look at this when I get back. ![]() Thanks, Daz |
|||
|
10-20-2011, 08:25 PM
Post: #7
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
Oh, forgot to say with regards to the Perl version to use, just go with the latest one (5.12) unless you have a real reason to stick with 5.10.
You're going to have to re-install your modules either way by the looks of it... |
|||
|
10-21-2011, 05:04 PM
(This post was last modified: 10-21-2011 05:05 PM by scottmccracken.)
Post: #8
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
Daz,
Thanks so much for your suggestions! I'm learning a bit about Perl as I go but must admit this stuff still confuses me to no end. Everything you mentioned made sense, so I fired up cpan plus and tried reinstalling the modules. Unfortunately I ran into the following error when running i DBI: Code: Installing DBI (1.616)I honestly can't tell if it's a permissions issue or if I'm missing a makefile? I was hoping it was going to be easy, but I guess that was asking too much. Any further suggestions you have for me would be much appreciated. Thanks, Scott |
|||
|
11-08-2011, 09:26 AM
Post: #9
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
Hi Scott,
Are you still having issues with this one? If you are let me know and i'll have a good look at it this week. Cheers, Daz |
|||
|
11-11-2011, 11:19 PM
Post: #10
|
|||
|
|||
|
RE: Install DBD::MySQL on Mac OS X Snow Leopard
Hi Daz,
Unfortunately, yes. I'm still getting the following errors when trying to reinstall DBI via CPAN plus: Code: [ERROR] MAKE failed: No such file or directory open3: exec of /usr/bin/make failed at /System/Library/Perl/5.12/IPC/Cmd.pm line 1010I'm wondering if I need to uninstall, then install the module? Honestly though, I have no clue where to turn next. Any help would be appreciated! Thanks so much, Scott |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread:

Search
Member List
Help





