After considerable effort, I’ve finally got OpenMRS installed on OS X. Over the past day or so, a few installs on OS X have come up, and I’m happy to join those who have got an install working. My Powerbook, an Apple PPC laptop, now is successfully running MySQL, Tomcat, and the like in a satisfactory way such that OpenMRS will run.

Recently, the guide for developers setting up OpenMRS on OS X has surfaced as Step-by-Step Installation for Developers on OS X on the OpenMRS wiki. I tried to follow the page, as I had almost everything done already. I upgraded my version of Ant and of Tomcat, and even to the latest not-quite-supported version of Java from the Apple Developer Connection. It wouldn’t quite work, for some reason. My errors changed sometimes, but the error I couldn’t fix was that OpenMRS was deployed in Tomcat, but Tomcat couldn’t start the application for some reason.

The web interface gave no clue as to what the problem was (any clues to the answer would be hidden in a log file, of course). I searched through the log file catalina.out in Tomcat’s logs folder, and above a massive (I mean massive) stacktrace, I found this:

Attempted reconnect 3 times. Giving up.
Could not connect to database using url ‘jdbc:mysql://localhost:3306/openmrs?autoReconnect=true’, username ‘test’, and pw ‘****’. Connection properties can be set with runtime property: ‘connection.username’, ‘connection.password’, and ‘connection.url’

Fun. Apparently, there is a problem with MySQL. I can’t connect with username ‘test’ and password ‘test,’ the defaults, which should have been created by the sql scripts I ran earlier. However, MySQL is a silly little creature. The user exists; I made sure by looking at some columns from the mysql.user table. But I can’t log in. I can log in without a password..but why not with the password he is assigned? I note that the other users (root, etc) have hosts that are normal, and work with passwords. The host for ‘test’ is ‘%’. So I delete that user, and create a new user with host ‘localhost’. Miraculously, this works. OpenMRS is now installed in my mac:

OpenMRS on OS X

I added the solution to my problem to the OS X install wiki page, which seems even more reasonable seeing as I have since learned that Anders was having the same problem on his Macbook Pro. This is clearly not even limited to old macs, much less my own computer.