0
votes

I installed MySQLdb module for python2.7 using

pip install mysql-python

But when I try to access I get the error below. Would appreciate if you can help solve the issue

root# python Python 2.7.14 (default, Oct 17 2017, 19:22:55) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import MySQLdb Traceback (most recent call last): File "", line 1, in File "/home/y/lib/python2.7/site-packages/MySQLdb/init.py", line 19, in import _mysql ImportError: libperconaserverclient.so.18: cannot open shared object file: No such file or directory

1

1 Answers

0
votes

On Ubuntu it is advised to use the distributions repository. Try installing with the following command:

sudo apt-get install python-mysqldb

To get all the prerequisites for python-mysqldb to install it using pip, run this:

sudo apt-get install build-essential python-dev libmysqlclient-dev