Installing MySQL51 Using MacPorts from Scratch for Lion

  1. Install the packages
    1. sudo port install mysql51 mysql51-server
  2. Initialize the db
    1. sudo -u _mysql /opt/local/lib/mysql51/bin/mysql_install_db
  3. Make mysql51 the default
    1. sudo port select mysql mysql51
  4. Run the daemon
    1. cd /opt/local ; sudo /opt/local/lib/mysql51/bin/mysqld_safe &
  5. Check to see its working by running mysql -uroot which should bring you into the interactive mysql shell as root user
  6. Setup
    1. /opt/local/lib/mysql51/bin/mysql_secure_installation

Other Notes:

  • For MySQL51, running cd /opt/local/mysql-test ; perl results in an error Can’t open perl script “”: No such file or directory. This is a reported bug.
  • Using zsh, running which mysql results in mysql: aliased to nocorrect mysql. To see the path. If you’re having problems getting mysql command to work, try this solution.
  • If you’re running into this error while connecting to MySQL Work Bench or Sequel Pro, MySQL said: Lost connection to MySQL server at ‘reading initial communication packet’, system error: 61, the fix is to comment out skip-networking in the my.cnf or macports-default.cnf file found at /opt/local/etc/mysql51

Programmers and Music

On the internet, no one knows you’re a dog

Randomly came across this comment by Zed Shaw. The whole thread is worth a read. It’s about a parent having a go at her son for spending all day long playing the guitar. Tough love.

Linguistic skills. Music is a language, and so is programming. But, they’re both sort of fake languages that are fairly small when compared to a human language. This ability to learn and apply small made up languages gives musicians an edge when learning to code. Programmers will typically learn 4-6 languages during their career, and if they want to stay sharp they might have to learn that many a year. A musician might never learn more than just one notation, but this ability to learn a sort of fake language helps them with learning programming.

I’ve been noticing a high correlation between programmers and music ever since I started coding 2 years back. Besides Zed Shaw, other prominent programmers/musicians:

  • Derek Sivers of the CD Baby fame is a self taught programmer
  • Adrian Holovaty of the Django fame. Here is him playing Super Mario. His latest startup, Soundslice is really pretty (and useful too)

A cursory search on Google turns up this post:

I think one of the closest similarities between programming and playing music is instant gratification. You write some code, refresh/compile, and you see the results immediately. Same with music, you play a riff or a chord, you get feedback instantly. The feedback loop is there to see and the more time you spend at it, the better you get. Once you start seeing improvement, you get addicted. It’s the same psychology behind self-efficacy — the feeling that you’re making good use of your time.

How To Hire A Programmer When You’re Not A Programmer

37 Signals has a post on how to hire a tech guy if you’re not techie yourself. It’s a good high level post. Here are some of my additional thoughts from a techie point of view.

Is He On Stackoverflow?

If the programmer doesn’t have a Stackoverflow(SO) account, that’s -1 point for me. Having an SO account is a prerequisite these days. Ok, so he has an SO account, what is his activity rate like? Does has ask more questions then answers? Generally speaking, having a high score from asking questions is not as impressive as having a high score from answering questions.

Is He On Github Or Bitbucket?

It’s a very bad sign if he’s not on either sites. Look into the number of repositories he’s created and if they are popular as indicated by number of stars and forks. Also, check out the projects he has forked. Forked projects indicate an itch he’s trying to solve for his own project which shows he’s able to:

  1. Trouble shoot his own problems
  2. Get things done
  3. Use an existing solution, tweak it without re-rolling this own solution which would undoubtedly take longer and potentially be buggier

Does He Display An Ability To Learn

Programming is one of those industries which redefines the goal posts every year. To use the cliche, change is really the only constant. It is of utmost importance that he possess a growth mindset and has the ability to learn autonomously. One way of spotting this trait is by looking at his background. Some of the most effective programmers I know are autodidacts who started their career in a completely different field.  Of course, this is by no means a litmus test but it does shed light on the candidate.

Is He Intellectually Curious

This point is heavily correlated with the previous point. Most of the best programmers are intellectually curious; not necessary in programming itself. I find the best way to see this in a person is through an informal conversation. Looking at this pet projects or what he does in his free time is also a good place to start. Does he hack on arduino projects in his free time? Is he learning to play a musical instrument? Does his twitter feed contain good observations about current affairs?


Communication is an a key trait that most people overlook. A “good” programmer that is unable to communicate his ideas well is a bad programmer. Most projects that go south stems from misunderstanding of project requirements. Again, the best way to see this is having a face to face chat and see how he articulates his thoughts. If he maintains a blog, read it. If he is on twitter, follow him. One side point: if he keeps a blog that is mostly tech-oriented, that’s good sign that he’s passionate about what he does.

If you’re bringing him on trial, take note of his responsiveness and willingness to ask questions. The more initiative he takes in seeking to clarify uncertainties, the better.

Does He Give Back To The Community

No one likes to work with an asshole. One good litmus asshole test is to see if he gives back to the community. Does he hold meetup sessions? Is he answering questions on Stackoverflow? Does he blog about this discoveries? Does he active in the local user group that he specialises in? Does he respond to newbie questions in a polite manner as opposed to RTFM?

At the end of the day, you should beg/borrow/steal another programmer to screen him for his actual technical competence. If he can’t produce fizzbuzz in under 5 minutes, you’ve got a stinker no matter how well he passes all the points I’ve listed above. To quote Jeff Atwood:

“Maybe it’s foolish to begin interviewing a programmer without looking at their code first”

Sounds like a no-brainer to me.