Installing the Python-MySQL (MySQLdb) connector using the Yum package manager and easy_install

You’ll notice if you try to just do this:

sudo easy_install MySQL-python

You’ll get some errors. That’s because you’re probably missing some libraries.

I was doing this on EC2 using the Amazon Linux AMI configuration (Amazon’s version of Linux) and this uses the yum package manager. For Ubuntu there should be similar apt-get commands.

So do this first:

sudo yum install mysql-devel python-devel MySQL-python

And then the first command should work.