0

I'm trying to setup mysql on my production server(Ubuntu 12.04). I followed this tutorial http://www.saltycrane.com/blog/2008/07/how-set-django-mysql-ubuntu-hardy/ Then I run python manage.py syncdb It shows this error https://gist.github.com/2777611

I also checked this out Getting "Error loading MySQLdb module: No module named MySQLdb" - have tried previously posted solutions Then I tried running pip install MySQL-python but no use, which shows this error https://gist.github.com/2777629

Could anyone tell me the problem?

Thanks!

Community
  • 1
  • 1
rnk
  • 2,174
  • 4
  • 35
  • 57

2 Answers2

3

You can either install the python MySQL libraries included in the Ubuntu repositories:

sudo apt-get install python-mysqldb

(in which case you don't need to do the pip install MySQL-python)


Or you can install the MySQL development libraries and then try the pip install MySQL-python technique:

sudo apt-get install libmysqlclient-dev
dgel
  • 16,352
  • 8
  • 58
  • 75
0

dgel has already answered but I want to add some few things just so it would be easy for beginners. At first I suggest to setup virtualenv.

Then if you are python 2.7 install

pip install mysql-python

or if you are using python 3.x

pip install mysqlclient
sage poudel
  • 357
  • 4
  • 14