批处理下如何自动输入密码?

zhusizhi007 2011-11-05 07:34:58
windows XP下安装了postgresql数据库后,想做个双硬盘的备份,但是调用以下批处理的命令时,会要求输入用户postgres的密码,如何在批处理文件中自动实现输入密码?
pg_dump -h localhost -p 5432 -U postgres db_storelib > "d:\storelib_20111105.backup"
...全文
1149 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
莲花一朵 2013-07-31
  • 打赏
  • 举报
回复
这个问题怎么解决的?我很好奇也需要啊
nlchycg 2012-10-25
  • 打赏
  • 举报
回复
楼主,你的问题是怎么解决的啊
echo 密码|pg_dump -h localhost -p 5432 -U postgres db_storelib > "d:\storelib_20111105.backup" 这样不管用啊?
smartiyi 2012-09-20
  • 打赏
  • 举报
回复
正是我需要的。
struggle1 2011-11-14
  • 打赏
  • 举报
回复
有关部门强调, 给分时不均匀,加罚分数,然后均分
zhusizhi007 2011-11-14
  • 打赏
  • 举报
回复
CSDN中果然有很多高手啊
Forever_Young 2011-11-14
  • 打赏
  • 举报
回复
官方规定,结贴时所有分数须填在一楼的框里,违者删帖,分没收。
ljc007 2011-11-14
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 qwlong007 的回复:]
CSDN中果然有很多高手啊
[/Quote]
Q: 在CSDN上发帖提问后怎样结帖给分?

A: 打开你的帖子→点击帖子左上角的“结贴”按钮→在回帖用户的得分框里面输入分数→点击帖子左下角的“结贴给分”
ljc007 2011-11-06
  • 打赏
  • 举报
回复
-w
--no-password
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.
Forever_Young 2011-11-05
  • 打赏
  • 举报
回复
试试下面的格式行不行

echo 密码|pg_dump -h localhost -p 5432 -U postgres db_storelib > "d:\storelib_20111105.backup"

6,849

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧