博客表的 Djangosyncdb 错误
我正在关注本教程: http://www.programmersbook .com/page/21/Django-Beginner-Tutorial-Part-I/
并添加了数据库详细信息(运行 django.db.backends.postgresql_psycopg2),并添加了模板目录。但是当我这样做时,
./manage.py syncdb
我得到:
self.connection = Database.connect(**conn_params)
psycopg2.OperationalError: could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
关于如何解决这个问题有什么建议吗?
i'm following this tutorial: http://www.programmersbook.com/page/21/Django-Beginner-Tutorial-Part-I/
and I added the database details (running django.db.backends.postgresql_psycopg2) and i added the template dirs. But when i do
./manage.py syncdb
i get:
self.connection = Database.connect(**conn_params)
psycopg2.OperationalError: could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
Any suggestions on how i can fix this please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在连接数据库之前,您需要安装数据库服务器,并配置它以供任何用户访问。
如果您只想按照教程使用 SQLite - 这是最简单的配置。
否则,安装您选择的数据库服务器,创建数据库,配置访问权限,确保连接详细信息正确,和/或数据库服务器已启动并运行。
最好的方法是尝试通过命令行连接到服务器。
Before connecting to database you need to install database server, and configure it for any user to access.
If you want just follow tutorial use SQLite -it's most simple to configure.
Otherwise, install database server of your choose, create database, configure access, make sure that connection details are correct, and/or DB server is up and running.
Best way is try to connect to server via command line.