使用python需要连接mysql,在配置文件中填正确用户名和密码之后,运行python manage.py syncdb,报如下错误 backend = load_backend(db['ENGINE'])
File "D:\Program Files\python\Lib\site-packages\django\db\utils.py", line 32,in load_backendreturn import_module('.base', backend_name)File "D:\Program Files\python\Lib\site-packages\django\utils\importlib.py", line 35, in import_module__import__(name)File "D:\Program Files\python\Lib\site-packages\django\db\backends\mysql\base.py", line 14, in <module>raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb。到google一搜说是需要安装连接库,解决方法:下载一个非常小的程序,安上就OK了。这个程序叫做MySQL-python-1.2.2.win32-py2.5.exe这里有一个下载网址:http://sourceforge.net/project/downloading.php?group_id=22307&use_mirror=nchc&filename=MySQL-python-1.2.2.win32-py2.5.exe&7636932。我当初是在这里下载的。或者,你可以去这里 下载安装 MySQLdb