Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.3k views
in Technique[技术] by (71.8m points)

windows - Problems Installing PostgreSQL 9.2

I've been trying to install the 64bit version of PostgreSQL 9.2 for Windows on my machine (Windows 7 64bit) and get this error:

The environment variable COMPSPEC does not seem to point to the cmd.exe or there is a trailing semi colon present.

I've installed it as Administrator.

I disabled the antivirus (Microsoft Security Essentials) and the firewall.

Running:

"%COMSPEC%" /C "echo test ok"

returned test ok

I've checked my System Environment Variables for trailing semi colon and I couldn't find any.

I then installed the 32bit version and managed to get to the end of the install with a different error message stating: Problem running post-install step. Installation may not complete correctly Error reading the C:Program Files (x86)PostgreSQL9.2datapostgresql.conf but there is no postgresql.conf file in that directory. It did install the application and when I try to connect the server with the red X on it it says fail at the bottom and it won't connect after I type in my password.

How can I connect to this server connection?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

ComSpec is a generic error message for any installation failure.

Identifying the problem

  1. Navigate to below path c:UsersXXXXXXAppDataLocalTemp
  2. Open 'bitrock_installer_XXXX.log'
  3. Check, if you are getting below error:

Script stderr: '"C:UsersXXXXXAppDataLocalTempPOSTGR~1TEMP_C~1.BAT"' is not recognized as an internal or external command, operable program or batch file.

Error running

C:UsersXXXXXAppDataLocalTemp/postgresql_installer_47b21c4ea1/temp_check_comspec.bat :
'"C:UsersXXXXXAppDataLocalTempPOSTGR~1TEMP_C~1.BAT"' is not recognized as an internal or external command,

operable program or batch file.

This is a problem with '8.3 file names and directories' (e.g. 'Postgres Install' -> 'POSTGR~1') Microsoft article on disabling 8.3 file names and directories: https://support.microsoft.com/en-gb/kb/121007

Solution:

  1. Open command prompt in admin mode
  2. Execute following command to change the format based on your drive or all drives

    Sample commands:

    fsutil 8dot3name set 1"      - disable 8dot3 name creation on all volumes
    fsutil 8dot3name set C: 1"   - disable 8dot3 name creation on c:
    
  3. Execute the installation as a user having admin privileges

  4. After install, consider resetting the 8dot3name setting to default (2) to avoid unintended consequences

Hope it solves the problem!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...