MAMP MySQL Server Won’t Start

This was a common problem with past versions of MAMP and it continues to happen for some users in version 4.x. Fortunately, the fix is easy. The problem is that when exiting MAMP the MySQL processes continue to run and are not stopped. This post has two solutions. The first solution of killing running processes has worked for me pretty much all the time. The second solution is from one of the comments below.

  1. Quit MAMP. You may have to force quit when this happens as it does not shut down correctly.
  2. To show any MySQL processes currently running, open Terminal and from the command prompt run the command below.
    pgrep mysql
  3. Next, kill the MySQL processes by running the command below.
    pgrep mysql | xargs kill -9
  4. To verify they no longer exist, pgrep for mysql again and you should not have any processes returned.
    pgrep mysql
  5. Now Launch MAMP again and MySQL Server should start normally.

Alternative Solution

If the above solution does not work, this method should.

  1. Stop Mamp and kill the mysql processes as above.
  2. Rename the ib_logfileN (N is the log numbers) files to something else. Don’t delete these as you may need to return to them. The path to these files may be different on your system. On my system, I would do the following:
    mv /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile0 /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile_0
    mv /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile1 /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56/ib_logfile_1
  3. Restart MAMP and MySQL should start correctly.
    (Thanks to Daniel Erkalo for this alternative fix!)

I am done with the Freemium Business Model

I am done with “free”. I have come to the realization that most people who want something for free will never, ever think of paying you, no matter how valuable they find your service. I found this cold hard fact out over this Christmas holiday with my free Letter From Santa site. The site uses a freemium model allowing people to create personalized printable santa letters for their children for free. In addition to the free version, I also offered a paid version that includes a higher resolution letter, a personalized envelope and door hanger for a nominal cost.

Traffic was substantial this Christmas season, with over 120,000 unique visitors and  nearly 1,000,000 page views. The site was used to create over 50,000 free santa letters. It’s cool to know a site I built was used to bring joy to kids all around the world.

Free customers are higher maintenance than paying customers. I think it’s because they aren’t paying, they show little or no attention to directions. I focused on making the UI of the site drop dead simple and easy to use. I created a pretty thorough FAQ to answer 99.9% of the questions people might have. I even linked to the FAQ in the email response they got with their download links to the letter they created. I still had hundreds of free customers ask for help with simple questions that were answered in the FAQ. One the other side, the rate of paying customers who asked for help was much lower, under 20 people in fact.

What really made me change my mind about offering freemium was when I sent a thank you email a couple of days ago to everyone who used the site this Christmas. Many free customers flagged the email as spam! So let me get this straight, you just used my service to make something for your kid for free and then you nail me with a spam complaint?. When creating the letter, I have people agree to my privacy policy before they finish. It says I may contact them from time to time letting them know when our Easter Bunny Letters site opens for the holiday season. Basically, letting them know when they can get some more free stuff from me. I have an opt-out link on that policy page, and I included one in the email I sent right at the top, at the bottom and in the body of the email. No paying customers flagged the email as spam or even unsubscribed. Only the “Free” people were kind enough mark it as spam. This of course raises holy hell with my email provider which in turn causes me headaches.

So I am off to refactor my web app and take out the free journey and switch over to paid only.

UPDATE: This post made it to the first page on Hacker News, it’s also been Slashdotted and picked up by several tech blogs. Some of the comments have been great and informative, others not so much. Some people have made false assumptions and some I am convinced didn’t even read what I wrote. This is MY experience with freemium. I am not condemning the concept for everyone. If freemium works for your business, that’s great.

Dynamic Cross-Domain Canonical URL’s with PHP

Google announced support for specifying a canonical representation of content back in Feb of 2009. This was done in order to help webmasters avoid duplicate content in their sites by specifying the rel=”canonical” link element in the head section of duplicate pages. In December of 2009, Google announced the ability to implement the canonical tag cross-domain. This is particularly helpful for webmasters who have mulitple domain names pointing at the same content and cannot implement 301 redirects on their servers.

If you have a dynamic site, editing the head of each document individually is not possible. In this  situation you can utilize the Apache REQUEST_URI server variable in PHP to create the canonical link element dynamically. The example code is below:

<link rel="canonical" href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>" />

In this example, you would put the code snippet in the head area of your dynamic page(s) on your other domains ie. and This tells the search engines that no matter what the path or page is on those domains, the canonical location of that page is located on