Easy Mysql Python Connector Installation

I use Ansible to automate mysql database backup tasks and when doing mysql_db tasks I get this message: msg: the python mysqldb module is required

So, after many attempts to install python-mysqldb using Ansible tasks, I tried to install it manually by running the sudo apt-get install python-mysqldb and I received the following error message:

 Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python-mysqldb 

I am using Ubuntu 13.04 64 bit

What am I doing wrong?

How to install python-mysqldb using apt-get ?

+7
mysql-python ansible
source share
1 answer

Ubuntu 13.04 passed away in about 10 months. As the link says: " No more package updates will be accepted until 13.04 ." You must use Ubuntu 12.04 or Ubuntu 14.04, which are versions of LTS (long-term support).

However, for this particular problem, as @ phantom said, use pip.

 - pip: name=MySQL-python 

(note capitalization)

+7
source share

All Articles