Join 3,438 readers in helping fund MetaFilter (Hide)


OSX: Future as a programmer dashed by failure to interpret Terminal error
August 20, 2008 6:49 PM   Subscribe

Multiple sources credit this Hivelogic post as the definitive guide to getting MySQL up and running on a Mac OS X. But I can't get past the first few steps.

I am not a programmer. But I wish I was; they earn more than me and have the best office in the building. I know HTML and CSS and basic PHP. I have been trying out a bunch of Ruby, Python, Django, and PHP tutorials lately but they're all kind of useless because they're not directly applicable to a hosted, "live site" environment that I'm used to ... So, I'm trying to install MySQL on my Intel Macs running 10.5.4 (powerbook and imac) to have a local testing environment but BANG I'm an idiot and I cannot get through this apparently simple tutorial. Of course, the comments are closed and my Googling yields no answer. I was about to give up when I remembered my good friends over here.

Here's what happens, I try to download and build MySQL as instructed:

curl -O http://mysql.he.net/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz
tar xzvf mysql-5.0.45.tar.gz

But I get the following error:

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors

I've tried downloading newer versions of MySQL but I just don't know what I'm doing.
posted by metajc to Computers & Internet (12 answers total) 2 users marked this as a favorite
 
You can try MAMP :Macintosh, Apache, Mysql and PHP. I had managed to get MySQL working at one point on my Ibook but ran into issues if I were to say reboot with out remembering to shut down the Mysql first. This a lot easier to work with, or so I found, and have had no problem running test wordpress sites and a few other packages requiring PHP and Mysql. I wouldn't use it to host anything live to the web but for playing around/learning it works great and is really easy to install.
posted by Captain_Science at 6:58 PM on August 20, 2008


The file you downloaded is supposed to be compressed with gzip, but is not. You can type the command:

file mysql-5.0.45.tar.gz

and it will tell you what format the file is in. I suspect the file may actually have already been decompressed. Post the results here and you will be able to get more help.

If it is a tar archive and you are sure the file you downloaded is without error, try this instead:

tar xvf mysql-5.0.45.tar.gz

That omits the decompression part.
posted by procrastination at 6:59 PM on August 20, 2008 [1 favorite]


Rename the mysql-5.0.45.tar.gz file to mysql-5.0.45.tar and run the tar command again.
posted by purephase at 6:59 PM on August 20, 2008


to download the package, you may just want to start here and pick the appropriate package. (or scroll up a bit and use the packages for mac os x.)

there is probably little reason for you to need to compile mysql yourself, and the binary packages will be enough to get you going.
posted by jimw at 7:02 PM on August 20, 2008


the answers from procrastination and purephase about renaming the file you have downloaded are wrong. visit the url in a browser. note that it returns a 404 page. that version of mysql is quite old, and no longer available from the mirrors.
posted by jimw at 7:03 PM on August 20, 2008 [3 favorites]


jimw is 100% right. Try the following:

curl -O http://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.0/mysql-5.0.51b-osx10.5-x86.tar.gz
posted by purephase at 7:14 PM on August 20, 2008


Thanks, Jimw. I had tried renaming the file but, right, that didn't work.

I had also tried visiting that download page earlier today but was stymied by the options. I have an Intel Mac and couldn't figure out which of those options would get me on track with the Hivelogic tutorial.

This guy has some ideas but I can't really determine if that tutorial does what I need.

Captain Science, thanks. I will try your idea as soon as I maintain that I can't continue with the Hivelogic tutorial.
posted by metajc at 7:18 PM on August 20, 2008


Here is the mirror list for the latest OSX MySQL bundle.
posted by mkultra at 7:49 PM on August 20, 2008


MySQL provides package installers on this page that are much simpler to use than the tar.gz packages (and way, way simpler than compiling from source ala HiveLogic). You just mount the disk image, and then double-click the .pkg files to install them using Apple's Installer.app. If your Mac has a Core 2 Duo, you can use the x86_64, while if you only have a Core Duo Mac, you'll need the x86 package. I haven't used them in a while, but I remember it being quite simple.

There are, IIRC, two packages, one for MySQL itself and one for a startup item that will automatically start MySQL when you boot. There should also be a preference pane that you can install afterwards that provides you with a nice one-button start/stop interface for the server. That coupled with their OSX installation instructions should be enough to get you started. From a quick scan of the docs, it looks like nowadays the installer does everything but run the MySQL database server, which you can do using either the included control panel or startup item.
posted by boaz at 8:01 PM on August 20, 2008 [1 favorite]


If you're doing random Unixy stuff on your Mac, I highly recommend installing macports to deal with the boring prerequisites. Then it's just "sudo port install mysql5" or whatever. (The only thing I don't like about it is it insists on installing its own copies of open-source packages that are also on the Mac— so you end up with a Macports-built perl *and* the system perl, for example. Doesn't cause real problems for me but is a mild annoyance.)
posted by hattifattener at 9:29 PM on August 20, 2008


MAMP is the way to go. I installed it, ran it and it works well.

Best part is the widget that comes with it to stop and start the server.

why go through the command line debacle when there is an easier way to get your server running by a fairly painless install.

Good luck
posted by TeachTheDead at 6:12 AM on August 21, 2008


I second Macports, as hattifattener (yay Moomin references) suggests above. It is one badass piece of open-source software for procuring open source software for your mac. It's the 2nd thing I download onto any new (or new to me) Mac, after Firefox.
posted by Alterscape at 9:29 AM on August 21, 2008


« Older Why won't my car start?...   |  Help! I need a cute and quirky... Newer »
This thread is closed to new comments.