Im trying to connect mysql through python and have the following packages installed.
apt-get install python-pip
pip install flask
apt-get install python-mysqldb
pip install flask-restful
After searching few of the posts, tried installing the below too: (which doesnt seem to work or is not installing)
apt install libmysqlclient-devel
easy_install mysql-python
pip install MySQL-python
My python version : Python 2.7.12
In my script im using:
import MySQLdb
And in my command if i try:
python nameserver.py
I get the error as:
import MySQLdb ImportError: No module named MySQLdb
apt-get purge python-mysqldb
thenpip install MySQL-python