Postgres“无法将psql识别为内部或外部命令” [英] Postgres "psql not recognized as an internal or external command"
问题描述
对于Postgres,即使我已经将bin文件夹的位置设置为Windows 8中的path变量,我仍然多次出现此错误。
For Postgres, I keep getting this error multiple times even though I have already set the location of the bin folder to the path variable in Windows 8. Is there something else I'm missing?
(由于信誉不佳,我无法发布图片)
(I can't post pictures since I don't have enough reputation)
推荐答案
更新,因为我在Windows 10上尝试过,您确实需要将路径设置为以下内容:
; C:\Program Files\PostgreSQL\9.5\bin; C:\ \程序文件\PostgreSQL\9.5\lib
Just an update because I was trying it on Windows 10 you do need to set the path to the following:
;C:\Program Files\PostgreSQL\9.5\bin ;C:\Program Files\PostgreSQL\9.5\lib
您可以使用通过CMD来执行此操作设置PATH [路径]
或从我的
You can do that either through the CMD by using set PATH [the path]
or from my
计算机=>属性=>高级系统settings =>环境
变量=>系统变量
computer => properties => advanced system settings=> Environment Variables => System Variables
然后搜索路径。
重要::不要替换已经存在的PATH,只需在它们旁边添加一个,如下所示; C:\Program Files\PostgreSQL\ 9。 5\bin; C:\Program Files\PostgreSQL\9.5\lib
Important: don't replace the PATHs that are already there just add one beside them as follows ;C:\Program Files\PostgreSQL\9.5\bin ;C:\Program Files\PostgreSQL\9.5\lib
请注意:在Windows 10上,如果您遵循以下步骤:计算机=>属性=>高级系统设置=>环境变量=>系统变量>选择PATH,则实际上可以选择添加新行。单击编辑,添加/ bin和/ lib文件夹位置并保存更改。
Please note: On windows 10, if you follow this: computer => properties => advanced system settings=> Environment Variables => System Variables> select PATH, you actually get the option to add new row. Click Edit, add the /bin and /lib folder locations and save changes.
然后关闭命令提示符(如果打开),然后再次启动
尝试psql --version
如果它给出了答案,那么您就是如果不尝试,请尝试 echo%PATH%
,看看是否设置了设置的路径,是否添加了是否正确添加了路径。
Then close your command prompt if it's open and then start it again
try psql --version
If it gives you an answer then you are good to go if not try echo %PATH%
and see if the path you set was added or not and if it's added is it added correctly or not.
这篇关于Postgres“无法将psql识别为内部或外部命令”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!