Getting “Error loading MySQLdb module: No module n

2019-04-02 12:38发布

I can't connect with mysql and I can't do "python manage.py syncdb" on it

how to connect with mysql in django and django-cms without any error?

2条回答
再贱就再见
2楼-- · 2019-04-02 13:06

to connect to mysql with django

sudo apt-get install git          # to install git

sudo apt-get install python-pip   # to install pip

sudo pip install Django           # to install Django to your system

After that you should go to project path and then execute the following command, the same path of 'manage.py' file

pip install mysql-python

Finally you may synchronous your database without problem

python manage.py syncdb
查看更多
来,给爷笑一个
3楼-- · 2019-04-02 13:25

This is an error message you get if MySQLdb isn't installed on your computer.

The easiest way to install it would be by entering pip install MySQL-python into your command line.

查看更多
登录 后发表回答