Category Archives: SQL

Install Mysql for Local Dev on Mac OSX 10.6

Do not be intimidated, it’s not that hard.

If you don’t mind reading a little documentation, the hardest thing about installing Mysql (IMO) is figuring out what package to install.

If you’ve previously tried and failed (and done who knows what to your local config) or if you don’t have a particular reason not to, why don’t you just get MAMP and skip all this?

USE THIS INFORMATION AT YOUR OWN RISK. Any information found on this website is offered only as informational and includes no warranty, guarantees or support. The author claims no authority on any subject whatsoever.

  1. Go to http://dev.mysql.com/downloads/mysql/
    • This will offer latest version (yes, you want the MySQL Community Server, btw) – if you have a good reason, you can access a previous version from here as well.
  2. Choose the DMG Archive for your architecture (32-bit or 64-bit). You’ll have to log in or (more likely if you’re reading this article) register with MySQL. It’s annoying but fast and I’ve never received spam from them.
  3. After jumping through sign in and mirror download hoops you’ll have a DMG file, something like mysql-5.x.x-osx10.6-x86.DMG which will contain an similarly named .pkg file. That’s all you need. But the most important file is the ReadMe.txt – which is actually useful and contains important steps you need to take. Open the ReadMe.txt.
  4. Read the ReadMe.txt file.

Ok, before you get mad at me – a lot of folks don’t provide useful ReadMe files, which is why I think it’s worth calling out in this case. Also, I saw so many tutorials on this, and worse, problems in forums where it was clear they didn’t follow the steps provided. Also, there are docs online that are mostly a repeat of this file – but it’s easy to accidentally read instructions for the wrong product version. So, as we OGs say, RTFM.

Following are notes from my specific install experience. It may be useful for you but you’ll need to verify your own system paths and configuration. Happy databasing!

  • Restarted apache a whole bunch, can’t remember when or exactly when you need to but if something doesn’t work, that might help:
    sudo apachectl -k restart

  • I installed MySQLStartupItem.pkg – while regularly using it this makes sense, and it’s easy to stop auto startup when you’re done working on a project using mysql. Also the commands to start Mysql are much shorter this way and I’m lazy.
    $ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
    (ENTER YOUR PASSWORD, IF NECESSARY)

  • Update my PATH environment variable:
    //make a back up in case you muck something up
    $ sudo cp /etc/paths /etc/paths_BAK 
    // edit your paths file - see vi reference or using pico, vim, emacs whatever
    $ sudo vi /etc/paths
    // insert /usr/local/mysql/bin and then save/quit
    // test result
    $ echo $PATH
    // do you see /usr/local/mysql/bin in there somewheres? good!
    $ mysql
    // is bash prompt replaced with mysql> ? yay!
    

  • Create a password for root:
    $ mysqladmin -u root password aw3^s0mePAs5

More good notes (for 5.5, be sure to select correct manual option):

What Next?

  • Login, create a db, do stuff, lern stuff
    $ mysql --help
    $ mysql -u root -p
    mysql> SHOW DATABASES;
    mysql> \h
  • Install a GUI - I like 'em, it's nice for visualization, although I think you definitely learn more & more better if you stick with CLI or at least the query window.
    • Sequel Pro - recently turned onto this. LOVE it. Good review here.
    • MySQL Workbench - the official one. Cause you're a company wo/man!
    • PHP MyAdmin - cause you an OG! And/or you follow or make a lot of tutorials (most apache web hosts provide this).
    • Querious - cause it's worth a few bucks for a nice user experience.
    • Navicat - cause money is no object! (If that's the case, please get me a copy! Love but cannot justify $$ at this time.)

First Impressions of SQL Server Manager

A couple of things jump out immediately:

  • They’ve recruited and listened to some UI experts
  • It’s not terribly different from Enterprise Manager

I honestly didn’t think I would like the new SQL Server Manager…mostly because I already like Enterprise Manager and Query Analyzer. I was SO wrong, yippee! It’s flippin sweet. I especially love the new integrated script features – you can script just about anything you would do in the GUI. This is most excellent for learning and uber useful for making triggers and DTS pacakage and all sorts of things! Check it out…

new script features in SQL Server Management Studio

The merging of SQL Enterprise Manager and Query Analyzer will save plenty of time going back and forth, it’s an obvious move… Another obvious enhangement to Windows apps in general, one that gives me hope in terms of M$‘s direction, is the easy copying of error messages, relevant error messages and a help feature integrated in the error dialogue itself that lets you select different portions with which to query online help. It’s like they don’t want to torture us anymore!!!
helpful error message in visual studio 2005

Don’t tell my linux friends please, but I’m getting really excited now about Longhorn coming out. It could be much easier to support.