MySQLdb is an api for accessing MySQL database using python. It is built on top of MySQL C API.
MySQLdb don’t yet have support for python 3, it supports only python 2.4 – 2.7 . As a result you need to use python 2 for this tutorial. We will be using python 2.7.9, which you can download from here.
Before installing you must first check whether MySQLdb is already installed on your system. To test open command prompt or terminal, then start python shell and type the following code
If it throws ImportError like this
then you need to install MySQLdb. Otherwise you have MySQLdb installed.
If you are on windows download the MySQLdb from here and install it.
In the next post we will discuss the steps we need to take to access database.