Monthly Archives: September 2014

MySQL Time Zone on OS X Mavericks

Setting up the time zone table on your MySQL instance on OS X shouldn’t be this hard, but it is. Normally, you do this with the following simple command and you’re done, but not on OS X.

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

The first problem you’ll encounter is that mysql_tzinfo_to_sql is not accessible from the command line. You either have to walk the path to its location and prepend the command with a dot or you have to reference the full path before the command (sans the dot).

The second problem you’ll encounter is that there are multiple errors in the time zone files, which will prevent the data from loading. I found a few options for dealing with this, but the easiest — by far — was to tell MySQL to force-load the files that worked and skip those that didn’t.

Here is the working command on my Mac.

/usr/local/mysql/bin/mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p --force mysql

MySQL & Perl on OS X Mavericks

After upgrading to Mavericks, my local development environment stopped working — more specifically, Perl would no longer talk to MySQL.

Recently, I decided to figure it out.

I was getting the following error from a Perl script that was trying to talk to my database. The database was there, it was accessible from the command line, and I verified that my Perl DBI libraries were installed.

install_driver(mysql) failed: Can't load '/Library/Perl/5.16/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Library/Perl/5.16/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Library/Perl/5.16/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
  Reason: image not found at /System/Library/Perl/5.16/darwin-thread-multi-2level/DynaLoader.pm line 194.
 at (eval 21) line 3.

After some searching, I realized that Perl was trying to load MySQL, but from the wrong location. Perl expected the libmysqlclient.dylib to live at /usr/lib but Mavericks had installed it at /usr/local.

So, I created a symlink to redirect Perl to the right location.

sudo ln -s /usr/local/mysql-5.6.17-osx10.7-x86_64/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

It should be noted that libmysqlclient.dylib will contain version information in the filename and Perl will expect it there. Your version is likely different than mine, so be sure to update it as needed. If you’re wondering, what version Perl is looking for, read your error message and that will tell you.

Requisite First Post

Hi folks, this is the requisite first post of a new blog to tell you what to expect.

The reality is that you can expect anything: Personal Notes, Technical Documentation, Mobile Rants, Technology Reviews, Journalism Missives, or anything else I have in mind at the time. I decided to set up this blog so that I can talk — at length (i.e. not Twitter shortness) — about topics of import to me and perhaps others.

I’ve tried focused blogs in the past, but I keep abandoning them because I want to talk about other subjects. My goal is to blog more often based on things I read. That means I need an open blog with no forced subject matter. It’s going to be wide open.

Who am I? Well, you can read more about me in my resume or the summary page I created on my web site, but here’s a quick synopsis. I am a former newspaper journalist turned technologist turned software development manager. I’ve worked in print, online and mobile. I’m now managing software teams building cash automation tools. I’m a father, a husband, a brother, a son, a Christian, a Democrat and more.

As a crime reporter, I’ve borne witness to people who died in car wrecks, shootings and by lethal injection. As a son, I was at my mother’s side, holding her hand when she passed away from lung cancer. I’ve interviewed killers by phone, in person and in prison. I’ve travelled near and far to investigate the motives of those who killed. I’ve angered federal judges, pissed off local and state cops, and been threatened by a state judge, a doctor and local government officials.

I’ve also managed the development, deployment and maintenance of more than 400 mobile products for about 200 customers. Everything from J2ME apps for flip phones to iOS apps for iPhone and iPad to Android, Kindle and mobile web apps. I conducted the first live stream to mobile for a local TV station in the US. You could’ve watched that last one on your BlackBerry or Treo in 2007.

That’s enough for now. I hope you enjoy the blog.

Tom Rouillard