Jun 29 2010

MySQL Training

A few weeks ago, I went to a MySQL training seminar focused on developing and tuning high-availability applications with MySQL, hosted by Percona and paid for by my work. It was an extremely informative seminar. We’ve hired the people at Percona before as our database ninjas, as I like to call them. They are not at all cheap to hire for consulting, but they are absolutely worth every penny. These guys live and breathe MySQL.

Anyway, I took away some good tidbits from the session, but more than that I gleaned some good general philosophies. For example, when diagnosing a problem first make sure it’s really a problem. If only a few users are experiencing it intermittently, then maybe it’s not worth 40 man-hours to investigate and fix. Another tips is: have good instrumentation. Don’t take educated guesses as to what might be slow — build in some metrics so that you can see exactly where a problem is.

A lot of this stuff is still sinking in, but I’ve already started putting some of it to use immediately. Good company investment, and a good personal investment too.


Mar 24 2010

MySQL “Can’t create table” error fix for WAMP

This is a post for the MySQL geeks out there, and also for anyone who had a similar problem and might be searching for a solution.

I was trying to copy our testing server’s database to my local machine, so I can do some local development (I’ve set up a web server and database on my personal computer, so that I can test things out before moving them to the development server). I’m using WAMP for that, which is a very simple way to set up a local webserver on Windows.

Well, when I tried to import the database I got the following error:

Error Code: 1005 - Can't create table 'whatever' (errno: 121)

So I edited my.ini, and increased max_allowed_packet, like so:

[mysqld]
max_allowed_packet=32M

I’ve heard that some other people have also had to increase wait_timeout to something like 45 seconds to fix this error.