所以,我在 OpenShift 上使用 django 快速入门,安装了 Mysql 5.1 和 PhpMyAdmin 4.0。我已经设置了一个数据库,并按照教程解决了这个错误。当我执行“python manage.py syncdb”时,会出现以下内容:
python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/core/management/base.py", line 231, in execute
self.validate()
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/core/management/validation.py", line 103, in get_validation_errors
connection.validation.validate_field(e, opts, f)
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/db/backends/mysql/validation.py", line 14, in validate_field
db_version = self.connection.get_server_version()
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/db/backends/mysql/base.py", line 411, in get_server_version
self.cursor()
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/db/backends/__init__.py", line 308, in cursor
cursor = util.CursorWrapper(self._cursor(), self)
File "/var/lib/openshift/526c6afd50044654c4000145/python/virtenv/lib/python2.6/site-packages/Django-1.4-py2.6.egg/django/db/backends/mysql/base.py", line 387, in _cursor
self.connection = Database.connect(**kwargs)
File "/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 187, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)")
有人知道这里发生了什么吗?我尝试创建一个新项目并按照相同的说明进行操作,但结果相同。