Failing to load a large Drupal database locally on your Mac Mountain Lion system

OK, so technically this could apply to non-Drupal databases, but Drupal was my particular issue here. Had a new hard drive, trying to get all of my sites up, and was having a tough time with a several gig large Drupal database. When it’s pretty big, you’ve gotta load it into MySQL via the command line. And, I was getting this error:

MySQL server has gone away

And then I’d go check MySQL and it would would still be there and I’d be all like, “You is a liar!” to my error. Cause that’s real effective.

As it turned out, I just needed to go into /etc/my.cnf and crank max_allowed_packet up to 64MB. Database loaded fine after that.

On a related note, once I loaded in my Drupal site, it looked all janky, like there was no css. Just straight up clearing caches wasn’t doing it. Had to go into /admin/config/development/performance and turn off pretty much all of the cache options, and from there my theme finally took hold.

Leave a Reply