pg_dump:命令行参数太多(第一个参数是“host=localhost”)

2024-10-06 12:45:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我也经历过类似的问题,但没有找到任何可行的解决办法。在

我尝试在我的Django项目中使用djang-dbbackup模块。 我运行$ python manage.py dbbackup并得到以下错误:

CommandConnectorError: Error running:  pg_dump last_cosmetics --host=localhost --username=postgres --no-password --clean 
b'pg_dump: too many command-line arguments (first is "--host=localhost")\r\nTry "pg_dump --help" for more information.\r\n'

我还试着在Windows命令下运行它。在

^{pr2}$

但我还是犯了同样的错误。在


Tags: 模块项目djangopylocalhosthostmanage错误
1条回答
网友
1楼 · 发布于 2024-10-06 12:45:31

您可以检查here中的语法。在

数据库名称应该是所有选项后的最后一个参数。在

因此,在您的案例中使用:

pg_dump  host=localhost  username=postgres  no-password  clean last_cosmetics

相关问题 更多 >