rnk
rnk

Reputation: 2204

django and mysql setup in production

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!

Upvotes: 0

Views: 1435

Answers (2)

sage poudel
sage poudel

Reputation: 357

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

Upvotes: 0

dgel
dgel

Reputation: 16786

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

Upvotes: 3

Related Questions