博客表的 Djangosyncdb 错误

发布于 2024-12-12 19:09:08 字数 631 浏览 2 评论 0原文

我正在关注本教程: 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

铁轨上的流浪者 2024-12-19 19:09:08

在连接数据库之前,您需要安装数据库服务器,并配置它以供任何用户访问。

如果您只想按照教程使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文