我正在使用 apache 运行基于 django 的 Web 应用程序。我可以从 python 和 linux shell 连接到 mysql,但是,当我运行服务器时,我收到以下错误。我在哪里做错了?
OperationalError at /
(2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
Request Method: GET
Request URL: http://dev.ls.co.uk/
Django Version: 1.3
Exception Type: OperationalError
Exception Value:
(2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
Exception Location: build/bdist.linux-x86_64/egg/MySQLdb/connections.py in __init__, line 187
Python Executable: /usr/bin/python
Python Version: 2.4.3