The database cluster initialisation failed but was not the same version as initdb的解决办法(postgresql)

发布时间 2023-10-12 08:54:23作者: 过错

问题:不论装哪个版本的postgresql,都报 The program "postgres" was found by ".../initdb.exe" but was not the same version as initdb. 和 The database cluster initialisation failed 的错误。
过程:
1 设置目录权限无效
2 更后版本无效
3 更改目录的路径无效

最后解决:根据网上的帖子。 我曾经因为命令行里的中文乱码,更改了注册表里的相关值,就是65001之类的那玩意。 只要把这个值清空就行了。
注册表位置: KEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun

备注:如果报某个文件没找到,比如a.dll找不到,就通过everything搜索到,把路径添加到,电脑变量的path里就行了。