{"id":81,"date":"2007-12-27T20:59:31","date_gmt":"2007-12-28T01:59:31","guid":{"rendered":"http:\/\/www.onvural.net\/melih\/wordpress\/?p=81"},"modified":"2007-12-27T20:59:31","modified_gmt":"2007-12-28T01:59:31","slug":"installing-dbdmysql-on-os-x-10411","status":"publish","type":"post","link":"https:\/\/www.onvural.net\/melih\/thoughts\/2007\/12\/27\/installing-dbdmysql-on-os-x-10411\/","title":{"rendered":"Installing DBD::mysql on OS X (10.4.11)"},"content":{"rendered":"<p>I was trying to get <a href=\"http:\/\/www.bugzilla.org\">Bugzilla<\/a> installed to act as my task manager on my local machine. It&#8217;s a new project that I&#8217;m trying out as part of my New Year&#8217;s Resolution of spending two hours everyday on a project of my own choice. It will help me to be organized, and give me an idea of priority over the tasks that I need to complete. It will also work better for me than using iCal or another calendar-based todo system. I&#8217;ve tried, they never work.<\/p>\n<p>In the process, since Bugzilla is a Perl based application, I needed to make sure to update my CPAN modules to the appropriate versions necessary for Bugzilla. It was generally smooth sailing until I ran into DBD::mysql. It won&#8217;t install naturally from CPAN, and getting it to work from the command line takes a bit of finessing as well. I thought I should write up what I found in case anyone else runs into this problem. This solution is based on Perl 5.8.6, MySQL 5.0.45, and Bugzilla 3.0.2.<\/p>\n<p>First, it turns out that the 5.* binary builds of the MySQL disk image distributed by the the MySQL Foundation for Mac OS X don&#8217;t come with shared libraries. Without these libraries, it seems that DBD::mysql won&#8217;t play along nicely. To build the shared libraries, you&#8217;re going to need the source directory for your version of MySQL, which for 5.0.45 can be found <a href=\"http:\/\/downloads.mysql.com\/archives\/mysql-5.0\/mysql-5.0.45.tar.gz\">here<\/a>. A very nice set of instructions for how to properly build these files is found <a href=\"http:\/\/switch.richard5.net\/isp-in-a-box-v2\/installing-mysql-on-mac-os-x\/\">here<\/a>.<\/p>\n<p>I&#8217;m not sure why DBD::Sponge is required, but without this package the tests failed, and <em>make<\/em> didn&#8217;t complete successfully. As a result, you&#8217;ll need to go ahead and run the following command to install DBD::Sponge<\/p>\n<blockquote><p>sudo perl -MCPAN -e &#8220;install DBD::Sponge&#8221;<\/p><\/blockquote>\n<p>At this point the following is assumed<\/p>\n<ol>\n<li>That you&#8217;ve got the MySQL shared libraries built.<\/li>\n<li>The DBI package is already installed<\/li>\n<li>That the DBD::Sponge package has also been installed<\/li>\n<\/ol>\n<p>Go ahead and try to install DBD::mysql using the following command<\/p>\n<blockquote><\/blockquote>\n<blockquote><p>sudo perl -MCPAN -e &#8220;install DBD::mysql&#8221;<\/p><\/blockquote>\n<p>It will attempt to install, but fail when it&#8217;s unable to complete the test steps. Next you&#8217;ll need to manually configure the Makefile parameters, and then run the <em>make<\/em> tools again. If you setup CPAN and MySQL to work with all of the default values, then the following set of commands should work for you. Also, as a note, this script assumes that your database user is root without a password with a database called <em>test<\/em> in the MySQL system. Otherwise, just change the directories as they are appropriate to your directory structure.<\/p>\n<blockquote><p>cd ~\/.cpan\/build\/DBD-mysql-4.005-{*}<br \/>\nsudo perl Makefile.PL \\<br \/>\n&#8211;cflags=&#8221;-I\/usr\/local\/mysql\/include -Os -arch i386 -fno-common&#8221; \\<br \/>\n&#8211;libs=&#8221;-L\/usr\/local\/mysql\/lib -lmysqlclient -lz -lm&#8221; \\<br \/>\n&#8211;testuser=root<br \/>\nsudo make<br \/>\nsudo make test<br \/>\nsudo make install<\/p><\/blockquote>\n<p>The {*} is a catch-all because I noticed that every time I tried to run DBD::mysql through CPAN it created a new random String that it appended to the end of the directory name. A simple <em>tab<\/em> at the point where you&#8217;ve reached the {*} should be enough.<\/p>\n<p>Run these set of commands in your Terminal application and you should be off and ready to go with the DBD::mysql module on Mac OS X.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was trying to get Bugzilla installed to act as my task manager on my local machine. It&#8217;s a new project that I&#8217;m trying out as part of my New Year&#8217;s Resolution of spending two hours everyday on a project of my own choice. It will help me to be organized, and give me an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[2,1],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pQyAq-1j","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":83,"url":"https:\/\/www.onvural.net\/melih\/thoughts\/2008\/01\/29\/well-darn\/","url_meta":{"origin":81,"position":0},"title":"Well darn...","date":"January 29, 2008","format":false,"excerpt":"And then the whole issue is resolved... All I had to do was wait for Bugzilla 3.0.3 (I installed 3.0.2), and the whole issue with the DBI package would have been resolved. Now isn't that a stinker.","rel":"","context":"In &quot;just thinking out loud&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11,"url":"https:\/\/www.onvural.net\/melih\/thoughts\/2006\/05\/04\/mysql-startup-error-2002-hy000\/","url_meta":{"origin":81,"position":1},"title":"MySQL: Startup Error 2002 (HY000)","date":"May 4, 2006","format":false,"excerpt":"I installed MySQL 5.0 on my MacBook Pro and got the following error when I tried starting the server after a computer restart: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '\/tmp\/mysql.sock' (2) It turns out that others were having this problem, and I wanted to go\u2026","rel":"","context":"In &quot;Technology&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":255,"url":"https:\/\/www.onvural.net\/melih\/thoughts\/2010\/02\/08\/another-bug-bites-the-dust\/","url_meta":{"origin":81,"position":2},"title":"Another bug bites the dust","date":"February 8, 2010","format":false,"excerpt":"I've been working on an interesting project lately that I hope to share with everyone soon. I keep running into the oddest of problems trying to get things going. It's almost as if just getting the whole thing started is the biggest challenge. After that... it's going to be a\u2026","rel":"","context":"In &quot;Technology&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12,"url":"https:\/\/www.onvural.net\/melih\/thoughts\/2006\/06\/06\/week-1-san-jose-new-town-new-start\/","url_meta":{"origin":81,"position":3},"title":"Week 1 - San Jose - New town, New start","date":"June 6, 2006","format":false,"excerpt":"One week has passed since I've come to California. The first week was really one long adjustment period. It's a week worth of learning a new town, getting used to a new time zone, and, ultimately, trying to impress the boss. My manager's, what IBM calls my mentor, name is\u2026","rel":"","context":"In &quot;Extreme Blue Internship&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/posts\/81"}],"collection":[{"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/comments?post=81"}],"version-history":[{"count":0,"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onvural.net\/melih\/thoughts\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}