Image representing Windows Live Mesh as depict...

Image via CrunchBase

I’ve been playing with the beta of Live Mesh from Microsoft for some time now, and find it a very useful technology. So far the only problem I’ve run into has been some bug that was introduced when I upgraded to Snow Leopard.

For some reason, after restarting or hibernating my machine, Live Mesh gets left in an odd state that leaves it unable to connect to the mesh, leaving it in a weird state where the login action is greyed out:

Live Mesh greyed out login

After a bit of Googling and searching around on the Microsoft Connect site for people experiencing this bug, I found a couple of different solutions.

Two possible workarounds, both require Live Mesh to be shut down:

Method 1: delete the Live Mesh preferences file ~/Library/Preferences/com.microsoft.LiveMesh.plist.

Live Mesh preferences

This method is what I typically use, since it is the least intrusive. It reconnects all the folders that I’ve added to my mesh, and re-establishes the synchronization. It does tend to fill up my hard drive with files, since the initial synch puts most (if not all) of the files in the folders into the Trash.

Method 2: Star with a clean slate:

  1. Quit the Live Mesh client.
  2. Delete the Live Mesh settings in Application Support (~LibraryApplication SupportLive Mesh).
  3. Delete the Live Mesh preference (~LibraryPreferencescom.microsoft.LiveMesh.plist).
  4. Launch Live Mesh client.
  5. Log in and select the folders you want to synch like you did originally.

This method is effectively like doing a complete uninstall, since it removes all the settings and preferences. It does cause a complete re-synch of the folders, and you can choose if you want to “merge” or “replace” based on whether you think you might need to or not.

This will also end up with lots of files in the Trash, so watch out for your disk filling up.

Method 3: Never shut down or let you machine sleep ;-)

Obviously, this method isn’t practical, but I figure I’d mention it. Until Microsoft adds some code to the Mac client it is probably worth trying to remember to shut down the Live Mesh client before you reboot or leave you machine in a state where it loses it’s connection with the network.

My guess is that the Microsoft developers aren’t listening for the right events, and therefore leaving things in a state where they don’t know how to recover. Most Mac apps are pretty smart about knowing when the machine is going to shut down, or when the network connection goes away, and handle the problem as gracefully as possible.

Live Mesh is still in beta, so it’s likely they will fix this before it becomes a real product. Like most Microsoft beta products, Live Mesh is still incredibly useful and solid on Windows. I’m hopeful it will get there on Snow Leopard as well.

This month has been a bad one for me and computers. First my MacBook Pro died (due to a video card that had been recalled), and then my desktop PC decided to fall over dead.

The Mac failure was another study in why I love Apple service: The video just died one day, no screen, external monitor wouldn’t work. Since a Mac has a real operating system (Mac OS X – a Unix variant), I was able to determine that the machine was actually still working by connecting from my desktop PC using ssh.

I did a bit of system administration black magic, and turned on the remote desktop service (see http://support.apple.com/kb/HT2370 or http://discussions.apple.com/thread.jspa?threadID=2081446&tstart=1 for a writeup of how), and was able to connect to my MBP using VNC. That allowed me to validate things were working, and to make sure I had a current backup before doing anything else.

A quick call to Apple’s support desk, and the helpful tech looked up the problem, found there was a recall on the video logic board for certain MBP systems, and walked me through a few things to validate it wasn’t just user error. He gave me a case number, told me to go to the Apple store, and have them check for the recall.

So I made an appointment at the store, got there a little early, and waited for that piece. In a reasonably short time, my “Genius” was testing my MBP for the recall issue, and sure enough that was the problem. Next a few minutes as he got the RMA set up, inspected the machine (noting that there was a small ding on the case), and asked me if I wanted it shipped back to my home address. The usual disclaimer about “if we can’t fix it, we might charge you $100 for looking at it”, and it was off to the races.

A couple of days later, I get a call from the Apple Repair Center. The guy on the phone tells me that yes, the recall is covered, but it appears the machine was dropped (which it was many moons ago), and there are all sorts of things that need to be replaced to bring the machine back to factory specs. This all comes with a price tag of $1,200 … Once I recovered my breath, I tell him “but at the store they said all I needed was the recall”. He tells me that, yes that would give me a working machine, and they could probably have fixed it at the store, but since it’s at the repair center they have to apply quality to it.

I tell the guy I’m not in a position to come up with the $1,200 right now, so can he ship it back to the store and let them do the repair. At this point, he tells me, that since I’ve been nice, and since I’m a good customer, he’s going to waive the fee. So Apple basically solidifies my glowing opinion of their service, and I get what for all intents and purposes is a brand new MacBook Pro.

I’m so relieved that this didn’t happen with my wife’s PC …..

Murphy’s law bites me again …

…. But while my MBP was off for service, I revived an old laptop I have for backup purposes. I had it almost completely configured when I got my MBP back. Then, a few days ago, my desktop PC (a Sony) crashed.

I go to the Sony web site, and do one of those instant chat sessions, and through a little back and forth, the chat agent tells me it is either a bad video card, or my memory has gone bad. In either case, it will require service. Now the wheels start spinning, because I know how much video cards cost, and I know I’ll have to pay a few hundred bucks just to get somebody to look at the machine (no Genius bar to bring my Sony to).

In the old days I would have just replaced the video card and memory with spares, but since I’m greener (and don’t really work on hardware any more) these days, I don’t keep things like that around. So now I have a useless desktop, with an unknown problem, with 500Gb of data that I can’t get to. Worse, the Sony has a RAID card, so I’m not sure the disks will be readable  except in that machine (it’s really 2x250Gb).

So I’m still trying to figure out what to do to recover the PC, but I’m guessing that will wait for a while …

Restoring my wife’s PC

Luckily for me, I had rebuilt my spare laptop, so I’m able to get the most important files onto my spare laptop, and within a few hours, it’s happily driving my big Gateway monitor (with Quicken and email files restored).

This is possible because of two backup strategies: Quicken online backup (which is a remarket of Connected Backup), and Microsoft Live Mesh.

I’ve used the Connected product ever since I learned about it while working at Cisco. They use the enterprise version, and it does a great incremental backup of your PC, that helped me recover accidental deleted files more than once. For a few bucks a month, the home version does the same thing for a few gig of data.

Live Mesh on the other hand, is a synchronization tool, that is a bit like the old Microsoft Briefcase on steroids. You mark a folder as being a Live Mesh folder, and it gets replicated to the Microsoft cloud. You can then synchronize that folder across systems, and even share it with other users. I created Live Mesh folders for all of my web site work as a way to share files with my clients, and to keep data on my Mac and PC in synch.

What I hadn’t really realized was that I was in effect getting a backup with this as well. I simply shared the folders to my backup laptop, and voila, I had all of my important data back and ready to update. For me, this is one more bit of evidence that there will continue to be interesting applications brought about by the cloud: I hadn’t really thought of Live Mesh as a backup strategy, and it lacks the versioning piece, but in a pinch it’ll do.

…Or how to brick your phone with an upgrade, and recover…

Earlier this month, Apple released the fifth beta of their 3.0 firmware for the iPhone. As usual, I raced to the site to download it.

I became very excited by the email that I got saying that submissions to the Apple store have to be compatible with iPhone OS 3.0, which to me means it won’t be long before this is a production OS. With that in mind, I strapped on my crazy cap and decided to upgrade my phone to beta 5.

Apple Announcement

After downloading the firmware and software for the new beta, I began the upgrade. According to the instructions, you needed the new beta of iTunes to do the upgrade, so that was the first thing that I installed.

Once that was ready, I followed the process that has become familiar to me for upgrading the phone:

  1. Launch iTunes
  2. Dock the phone
  3. Right click on the phone and choose backup
  4. After the backup click the “Restore” button while holding the option (alt) key.
  5. Browse for the new firmware and watch things roll.

As it turns out, the mistake I made at that point was clicking the “Restore” button, later I learned that beta 5 won’t install unless you click “Check for Update” while holding the option key.

The first thing I noticed was that there was an odd cartoon that flashed up on the screen with a pink background. I figured it was some developer’s Easter egg, so I didn’t worry too much. After the usual series of minutes of resetting the phone and iTunes validating the software, the upgrade told me it was done, and I waited for the final reboot. This is typically the point at which the phone reboots, and iTunes detects it and activates.

Instead I ended up with an endless wait, as the phone never rebooted. So I went through the usual tricks to get it to come back to life. Eventually it worked, and I got a pink screen that showed the graphic you see with a new phone.

I plugged it in again, only to find that it wasn’t recognizing the phone (which after several tries led me to believe that the upgrade was not complete).  Not only was the phone stuck, but I couldn’t seem to get it back into DFU to restore the software.

At this point it occurred to me that perhaps there was something nefarious going on: my phone had been jailbroken prior to the upgrade, so perhaps that was the issue. Luckily for me, I had my wife’s phone to play with, and it hadn’t been jailbroken, so I decided to try and upgrade it.

Unfortunately, that didn’t work, so now I had two phones that were basically useless. Digging around the web, I found some references to problems that people had with updating to beta 4, and a workaround for the pink screen problem. The workaround talked about the problem being related to a change in the USB drivers for OS X 10.5.6 that made getting a phone into DFU mode difficult, so I thought it was worth a try (see: http://gizmodo.com/5166029/how-to-install-unofficial-apps-on-your-iphone-3g-or-ipod-touch-easily-and-safely) .

After downgrading the USB drivers on my Mac, I was able to get it into DFU mode, and restore the 2.2.1 version of the firmware. Inspired by this, I tried upgrading my wife’s phone on a PC (figuring the problem was something in the USB drivers). Sure enough, her phone loaded the 3.0 software just fine.

So, once again, I tried upgrading my phone, and couldn’t get it to go. I tried it on the Mac, then on the PC, same results both times. For some reason it wouldn’t work. I could downgrade to 2.2.1, but not upgrade to 3.0.

More digging on the internet, and I found a posting on the iPhone developer forums that talked about installing beta 4 then upgrading to beta 5 if you have an old silver back phone (both of mine are the metal backed pre-3g phones). I figured it was worth a shot, so I downloaded a copy of the beta 4, and ran the upgrade. Eureka!  The beta 4 firmware upgrade worked !

At this point it had been a few days since I had my phone working, so I took a breath and decided to run with beta 4 for a while. I kept scouring the web and watching the discussion on the beta 5 upgrade problems to see what people were doing to get it to work.

In the mean time, I ran into an interesting (and scary) side effect of the USB driver downgrade. I forgot to upgrade the drivers after my successful downgrade of the firmware, not thinking that those drivers were actually for a different version of the OS. Whenever I plugged a USB stick into my machine, it would go into panic mode and shut down. I thought my hard drive was dying until I realized it only happened when I plugged in a USB stick, and remembered the driver downgrade. Upgrading to the current drivers fixed that issue.

Finally, I saw a post that talked about clicking the “Check for Upgrade” button while holding the option key instead of the “Restore” button. I decided to try this, and was amazed when it worked. So apparently, all along the secret was to use the upgrade button instead of the restore button. There’s some evidence that the reason this fails is because of part of the upgrade to the firmware, so it makes sense that there may be a difference in the way that iTunes processes an upgrade as compared to a restore.

At any rate, my current thinking of the process is as follows:

  1. Download the firmware and iTunes beta
  2. Install the iTunes beta
  3. Dock the phone
  4. Do a backup of the phone
  5. Option click the “Check for Update” button
  6. Choose the beta firmware IPSW file you downloaded
  7. Be happy if it works.
  8. If it doesn’t work, follow the link above to downgrade the USB drivers.
  9. Go through a normal restore (should put you back to 2.2.x)
  10. Repeat steps 5-7

Hopefully Apple will have this all figured out with the next release (and especially before the production update). As near as I can tell, this only affects the older phones, and doesn’t happen with the 3g iPhone.

I’ve been pretty happy with this iPhone OS, it seems to be quicker and more stable than the 2.2.1 was – still looking forward to the actual release.

Today I read a blog that was a continuation of the series of ads that Microsoft has about why you should buy a PC instead of a Mac.

The article (see http://tinyurl.com/cncx73) was one of those cutesy marketing ideas that looked at the alleged difference in cost between a Mac and a PC and came up with an imaginary tax rebate based on the savings. The author used this whitepaper as the basis for the comparison. Like all of these comparisons, comparing apples to oranges results in the preferred hardware (in this case the PC) being shown to be a better deal.

I do most of my work on a MacBook Pro, after being a laptop user for more years than I care to count. I switched when it became possible to do so without giving up Windows. With the current crop of Apple machines, you have the option of running Windows directly, setting things up to dual boot (BootCamp), or running Windows in a VM (using Parallels, Fusion, VirtualBox, etc.)

Which once again leads me to ask why would Microsoft bash Apple ?

For me, nothing changed in what I buy from Microsoft – I still need a copy of the operating system, and application suite. I can choose to run some parts under the Mac OS, or just use the Microsoft products as I always have. Granted there are open source alternatives for many of these, but that is true for both the Mac OS and Windows.

When I bought the first Macbook, it was only very slightly more than a comparable IBM thinkpad (which at the time was the business laptop of choice). The only selling point for me was that I would have a second operating system on which to test my development work. In other words, I was getting a dev box that I could use for much less than buying a second machine would have been.

My other reason for buying the MacBook was that it weighed about half of what the ThinkPad did, and had that nice aluminum shell to protect it. Lugging a laptop with a power supply and extra battery around cost me about 10-12pounds in my backpack, so reducing that by about half was very attractive (especially on the 20 mile bike ride home).

What I learned after the fact has made me very glad about making the purchase.

Advantage 1 – Better battery life

I gained a great deal of battery life. My first MacBook Pro gave me 4-6 hours of life on a charge, meaning I could go from meeting to meeting and not have to worry about it dying because I couldn’t find a plug. I could also make it through most flights without the machine dying. I used to have to lug extra batteries for this.

Advantage 2 – Instant sleep

On some laptop PC‘s, when you close the lid, it will try to sleep, or hibernate. The problem is that it doesn’t always work, and even if it does, it seems to take forever to wake back up (and occasionally won’t wake up). With the Mac, I was pleased to find that as soon as I closed the lid, the machine went to sleep. On the MacBook, the little power indicator does a slow blink to let you know it is asleep, and that happens almost immediately.

Especially on days that I was rushing out of the office to catch the train, or hop on my bike, it was immensely gratifying to know I didn’t have to worry about whether the machine actually was sleeping or not. I can recall a few times getting home, unpacking my PC, only to find that it had been ON in my backpack for the whole ride home (and sometimes had overheated because of being in that enclosed space). I eventually learned to shut down the machine before leaving, which meant another 15 minutes or more of non-productive time.

Advantage 3 – Start up time

When I was lugging a Thinkpad to work every day, I would plug it in, dock it and go get breakfast. That was because it took around half an hour to fully boot up the machine from being powered off.  With the Mac, if I had powered it all the way off, it only takes a minute or so to boot up, and it is almost instant when starting from sleep.

Advantage 4 – Support

While having a Thinkpad and working for a large corporation, I never had to really think about hardware support. If something broke, I’d just take it to the IT guys, and they’d get it working again (or replace it). When I went out on my own, the very scary possibility that my work machine might die came into play. I bought service contracts for my first few machines, and learned that while they protect you, it is definitely not the same as you get with the desktop support guys.

To get support, you had to wade through a web site, and it was almost impossible to find a real person to talk to (other than the chat bots that everybody seems to use now). And if you had a hardware problem, it was: ship it back to us, we’ll fix it and if it was under warranty we won’t charge you, average turnaround two weeks.

To be fair, I’ve never bought a machine from one of the retail markets like Best Buy or Fry’s, and that’s mostly because of my experience when talking to the people that work there. My impression is that you’re not going to find stellar support there, since you’re basically working with a group that has a broader focus than just the PC’s they sell.

With my first Mac however, things were indeed different. I bought the machine through the web, and the first time I had a problem,  I was able to call support. And when I had my first actual issue (a hard drive failure that was caused by me dropping the Mac from about belly high), I took it to the store and they fixed it. Let me say it again: they fixed it, and I only left it with them for a couple of days. And this was before I bought an Apple Care contract!

Advantage Mac OS X

So for me, the advantage is clear, and Microsoft doesn’t even lose out since they don’t sell hardware. I gain significantly in productivity with the Mac, and have my VM for those Microsoft apps I need to stay compatible.

I still don’t get why Microsoft bashes the Mac, maybe they’re worried about the home user who might not need any PC software, but that seems like a sale they would have lost anyway. I’ll continue to buy solid hardware like Apple makes, and decide on which operating system based on the needs I have to interact with my customers, which will include Windows for the forseeable future.

Recently I downloaded the iPhone beta 3.0 firmware upgrade and decided (without thinking it through) to update my phone to use the new version. In hindsight, Apple makes it pretty clear this is a bad idea, and warns you that you won’t be able to revert to a prior version of the software:

iphone upgrade warning

But warnings were meant to be ignored, so I blithely went ahead and updated with the new firmware. Immediately after doing so, I had a d’oh moment when I realized I better not have my business phone running on beta software, so I wanted to revert.

No problem I thought, I’ll just follow the steps to downgrade that I wrote about previously

Well, this turned out not to be so easy, as soon as I tried to reload the prior version of software, I got to a place where the firmware restore would simply stall, and eventually fail.

I tried every version of firmware on my machine, including the beta, and my phone simply couldn’t be reloaded.

Just when I thought I was going to have to give up and take the phone to the Apple store, I remembered that jail breaking your phone involves a process of putting your phone into DFU mode (allegedly stands for Device Firmware Update, but I think it stands for Dumb Frantic User).  In essence this does a hard reset of the phone and puts it back to a factory clean state.

Once  I fired up PwnageTool, and ran through the process of jail breaking my phone (mostly because it has a step that helps you through the steps of getting your phone into DFU mode), the restore of the firmware worked again, and I was able to restore to the current 2.2.1 version of the firmware without any problems.

On the first day of 360iDev, I was in a session to learn about programming an iPhone, and somebody mentioned that a friend of theirs had updated their iPod firmware, and couldn’t figure out how to reset it back to the prior version. Since I had recently done this, I thought I could write this walk-through.

Apple uses the iTunes application to upgrade your operating system which does a nice job and for the most part protects you from doing anything too terrible by automating the process. On the iPhone, iTunes will give you an alert about the availability of a new operating system, and ask you if you’d like to upgrade, and tell you that if you have problems you will have the option to restore from a backup.

The interesting thing about the backup piece though, is that it doesn’t really restore the firmware, only the settings. For most users this is fine since the reason for needing to go through the “restore” process is actually because of a problem with the firmware, and the “restore” does all the work required to get your phone back to working with the new firmware and your old settings.

If however, you need to go to a prior version of the firmware, the process is not so obvious. Until recently I didn’t even think this was possible for somebody to restore to the prior version unless they were a developer.

After I updated my firmware on my iPhone recently, I noticed that my hard drive was getting to be very full, which prompted me to search for what was using up my disk space. This led me to find that the old version of the firmware gets saved by iTunes when you do the update.

Firmware files have an .ipsw extension and can be found at the following locations:

On Windows:
Documents and Settings\Application DataApple ComputeriTunesiPhone Software Updates

On Mac:
~/Library/iTunes/iPhone Software Updates

Sotware updates on my Mac

To restore the firmware to the prior version, do the following:

  1. Launch iTunes (with your iPhone connected)
  2. Click the button that says “Restore” while holding down the “Option” key (use the Shift key on Windows). Note: if you get a prompt asking if you want to back up your phone, you probably weren’t holding down the key when you clicked, and you’re actually going through the restore process.

Alternatively, if you’re an iPhone developer, the XCode Organizer can also drive this process of selecting a version to install on your phone.

Organizer

In either case, the actual firmware change is done through iTunes. Now you should see the firmware file being extracted:

extracting firmware

Your phone will be reset, and you’ll see the firmware being validated in iTunes:

validate firmware

Next you’ll see the update message:

Restoring

At this point your phone will be reset back to factory settings for that prior version of the firmware. You’ll probably get the prompt that tells you an update is available, which you can cancel.

Finally if you want to restore your settings, pick the backup you want to use (you can also tell it to set up as a new iPhone, which just means you won’t have any of your settings from before).  This will restore all of your apps and setting, although you may end up with a message that tells you about applications that won’t work if you have any that are for a newer version of the firmware (in other words if your backup contains an App version that wasn’t available for the firmware you reloaded).

App warning

After all of this, iTunes will probably ask you if you want to upgrade your firmware to the current version, which is how you would go back to the current version when you are ready to do so (or you can go through this whole process again to go to a specific version). You may want to turn off the automatic update checking if you are going to switch to other versions very often.

Note that your “problem” applications from the prior message will work once again after you are on a version of the firmware that is current enough to support thos applicatons.

One more thing I ran into after posting the blog on my Microsoft Office update problem originally. Turns out that the update reassociated all of the “Office” files with the Microsoft programs (even though they don’t exist on my machine), so double-clicking a document for instance tries to open it with Microsoft Word (which of course fails).

To reassociate the documents:

  1. Go to Finder and right click a document
  2. Choose “Get Info” from the pop-up
  3. Look for the section that says “Open with:”
  4. Change it to Open Office (or whatever your Office equivalent is).
  5. Click the “Change All …” button to make it global

Once that is done, double-clicking should once again open the file with the program you’ve picked.

I recently was seeing a few weird problems with Entourage and synching, so I decided to check and see if it was up to date.

I have a copy of Entourage 2008 that I got from an Exchange hosting service that I use for email with one of my partner companies.

Looking at the Entourage/About Entourage, I saw that I was running version 12.1.3,which was a couple of revs back from the current version (12.1.5). So I picked Update from the Help menu in Entourage:

Entourage Help/Update

I saw that I have my Autoupdate set to Automatic and check weekly, so I’m not sure why it wasn’t up to date.

Entourage Update

I clicked the “Check for Updates” button, and answered the questions so that the update started. Everything looked fine until it got to the page where it wants to install the update. The part that inspected the disk took a really long time, my CPU spiked, and I could hear my machine heating up. After a minute or two, the screen updated with a message telling me that it couldn’t find the right version to install this update.

Entourage Update Disk SearchEntourage Update Fail

So now it was off to scour the Mac sites for help with the problem. My guess was that this should be easy to find, I couldn’t be the only person ever to have installed Entourage from a hosting provider (meaning just Entourage, and not the rest of Office 2008 is installed on my Mac).

After many Google searches, and then a direct search at the Mactopia forums, I found a thread entitled “Cannot install 2008 update 12.1.4 or 12.1.5” and about halfway down the page was a post by dbsierra that explained how to do a workaround for this issue, which was to do the following steps:

  1. Download the Office 2008 update .dmg file.
    1. Mount the .dmg file on your desktop by double-clicking it.
    2. When the Office 2008 update window opens, drag the icon for the update to your desktop, it will take a sec to copy over. Close this window when it is done copying and you see Update file on your desktop.
    3. Unmount the .dmg file by either right-click on .dmg file, choose “Eject …”, or eject/unmount in Finder.
  2. Right-click on the Updater file on your desktop and choose “Show Package Contents”.
    1. Navigate to Contents folder, then Resources folder. Find the file named: package_updatable.
    2. Highlight the package_updatable file and right-click, choose “Get Info.”
    3. When Info window pops open, click on padlock in lower right corner (Note: you may need to expand the “Sharing and Permissions” section to see the lock icon).
      1. . Another window asking for your admin. password will pop up, type in your admin password and padlock should unlock with that satisfying open vault sound!
      2. In Info window click on gray triangle to show Sharing & Permissions. You need to change Privilege for your Admin. account from “Read only” to “Read & Write,” click on up/down triangles to do this.
      3. Click on padlock to lock file and close window
    4. Highlight the package_updatable file and right-click, choose “Open With” then “Other …” Click thru (ignore) the warning about opening Unix files. The Application folder in the Finder will be open, scroll down and choose TextEdit.
      1. TextEdit will have opened the file. Scroll down to find the following lines and delete them:if not found_valid_version:
        sys.exit(48)
      2. In the File menu of TextEdit, choose Save. The file should close. Close the Finder.
    5. Double-click on Office 2008 update file on your desktop. Follow on-screen update instructions as normal and hopefully that’s it.
    6. Re-boot, open up Office 2008 Apps and get on with your life!

I was able to force the update by doing these steps, although I did get an odd error in the middle (I’m guessing because it was trying to update Word or some other Office program that I don’t have installed), but it continued through, and now I have the “right” version (12.1.5).

I have been running my development for VolunteerCake with a database on my Windows box which sits in my office with my Mac. I went to meet some people at a coffee shop, and realized that I couldn’t show them the app running on my MacBook because I was no longer on the same subnet with my Windows box, so I decided to move the database to the Mac to allow me for this.

Since I had everything in place to run Cake on my Mac except for MySQL, the first step was to install MySQL. This turns out to be pretty painless. Just grab the DMG from the MySQL site, and voila, new MySQL running on my Mac. Checked everything out using the MySQL administration tools, and it all looks good (I can access the DB, set up users, etc.)

Next I need to put the data in the database, so I just do a quick export from the phpmyadmin page on the PC. I end up with a file that is the SQL needed to replicate the entire database on my Mac. I run this SQL into the Mac MySQL, and now I have an exact copy of the database on my Mac.

After that, I go to the SQL administrator tool and make sure I have the user set up to give access to that database and make sure the username and password are the same as I was using on the PC (if I were more of a DBA, I’d probably have done this with command line MySQL, but I like GUIs, especially for things I don’t do every day, and the MySQL tools are pretty cool).

Then I need to change my database.php to point at the local database in order for VolunteerCake to get the data from the Mac. This should be as easy as changing the name of the host name to ‘localhost’ from ‘monet’ since I’ve set up the user and access to the database exactly the same as what I had on the PC.

Finally, all that’s left is to fire up the same URL that I have established for my app on my Mac (http://test.lctd.org/VolunteerCake) and … wait, that didn’t work. It says it can’t find the table acos for the Aco model …

Weird, the table is there, I can connect just fine, what could this be? A quick trip to the IRC channel, and I get the suggestion of clearing my cache. OK, try that … But hit the URL again and no change.

OK, now I’m confused, so I try running ‘cake bake’ … Now something interesting: I get an error that tells me that it was unable to connect to /var/mysql/mysql.sock – what does that mean? I thought I was connecting with a TCP socket, why does it want a file? Is this some sort of file permissions issue ?

Back to the IRC chat for some guidance, thinking maybe it’s a common problem, a permissions issue or something, of course they tell me to do exactly what I’d tell somebody else to do: verify that you can connect from PHP first. Good idea – so I whip up a quick connection test page, and get the same error. So now I’ve confirmed that it’s a PHP problem, and not a Cake issue.PHP can connect to a remote DB, but not the one on my local Mac …

Now it occurs to me that I often have problems that end up being related to the open source software that came bundled with the Mac, so I do some Google searches on PHP connection to MySQL for Mac OS X, and with the connection error messages. Eventually I find what looks to be the issue: for some reason the MySQL configuration sets the socket file to /tmp/mysql.sock but the PHP that comes with the Mac is looking somewhere else (at /var/mysql/mysql.sock to be specific). So I basically have three choices, edit the php.ini, edit the mysql config file, or build symlinks to make the file accessible at both locations.

I decide to change the php.ini file, which turns out to be another excercise in hunting, since Mac OS X likes to hide the files you’d expect to find in the /etc directory. After some more Google searches, I find that the PHP5 install that comes with Leopard puts the php.ini file into /private/etc, so I edit that file, changing the part of the file that looks like the following:

To be:

In order to have PHP find the mysql.sock in the location that MySQL is actually creating it. Check my URL again, and voila, everything is working !!!

So, to make a long story even longer, I relearned that mixing actual open source with vendor open source is often problematic. It was suggested by at least one person (Mark Story) on the IRC channel that the best way to set up for Cake development on the Mac is to use MacPorts, since then you end up with matching versions of the software all in a “normal” open source location.

Enhanced by Zemanta