I’m following these instructions, however I can only get to step 17.2.
Despite installing postgresql successfully via the
sudo apt-get install postgresql
command, upon running
initdb -D /usr/local/pgsql/data
Ubuntu tells me that it ‘initdb’ isn’t installed. The instructions tell me this command is installed by
sudo apt-get install postgresql
so what’s going on? I can make initdb available by installing postgres-xc, but I think postgres-xc is just some weird third party rubbish, and it’s not detailed in the instructions. Any ideas?
asked Nov 5, 2013 at 21:20
You will find initdb
under /usr/lib/postgresql/x.y/bin/
. See also /usr/share/doc/postgresql-common/README.Debian.gz
for more information on the setup on Debian and Ubuntu.
answered Nov 6, 2013 at 2:00
5
initdb
is intended to be run under the postgres user account that is created during the install. After installing postgresql you can do:
sudo su - postgres
Then you should be able to run initdb
.
answered Jan 8, 2014 at 21:44
4
initdb
is not installed as user executable. Is only installed in /usr/lib/postgresql/X.X/bin/
, because it always depends on the version. initdb
can only be executed from that specific directory.
As mentioned in other answers, installation of postgres creates a default directory that may be in a limited partition. Users may want to change this, but it requires other steps also. see here.
answered Jul 14, 2018 at 4:32
ilias iliadisilias iliadis
3011 gold badge2 silver badges9 bronze badges
Follow the following steps with user root
passwd postgres
— your passwordsu postgres
psql
- Create a user with your user name like
CREATE USER SAM ;
create database sam;
- Log out and type
psql <your_user>
answered Jan 16, 2014 at 12:32
smn_onrockssmn_onrocks
5265 silver badges14 bronze badges
1
Содержание
- Failed to run initdb 1073741515 postgresql
- установка postgres: сбой при инициализации кластера базы данных (Postgresql версии 9.4.4)
- 12 ответов
- Ошибка файловой системы 1073741515 в Windows 7, Windows 10
- Как исправить ошибку файловой системы 1073741515 в Windows 7, 10
- 1. Используйте RegCure Pro, чтобы автоматически исправить ошибку
- 2. Избавьтесь от шпионских программ, используя утилиту для удаления Spyhunter Malware
- 3. Используйте Windows Repair, чтобы исправить ошибку
- 4. Обновить/Сбросить Windows 10
Failed to run initdb 1073741515 postgresql
Сообщения: 27627
Благодарности: 8084
Не удалось запустить приложение, поскольку его параллельная конфигурация неправильна. Дополнительные сведения содержатся в журнале событий приложений или используйте программу командной строки sxstrace.exe для получения дополнительных сведений.
» width=»100%» style=»BORDER-RIGHT: #719bd9 1px solid; BORDER-LEFT: #719bd9 1px solid; BORDER-BOTTOM: #719bd9 1px solid» cellpadding=»6″ cellspacing=»0″ border=»0″>
Сообщения: 64
Благодарности:
Качаем с сайта 1С дистрибутивы postgresql_9_1_9_1_1C и х86 и х64, я ставил обе версии библиотек. Оттуда берём файлы vcredist и устанавливаем в систему. Сам postgres этой версии устанавливать не надо (хотя никто не запрещает), задача была установить на чистый 2008 R2 SP1 postgresql_9_2_4_1_1C_x64. После установки библиотек устанавливаем postgresql_9_2_4_1_1C_x64. Который устанавливается нормально.
Источник
установка postgres: сбой при инициализации кластера базы данных (Postgresql версии 9.4.4)
Не могу установить Postgresql. Все перепробовала:
- Я запускаю установку как администратор.
- Я создаю пользователя postgresql и добавляю его в группу администраторов.
- Я устанавливаю его прямо на C: postgresql.
Но безуспешно. для информации: у меня windows 8
12 ответов
- Прежде всего запустите настройку от имени администратора.
- Выберите папку для установки внутри программных файлов (по умолчанию)
- Но выберите расположение данных вне указанной выше папки в другое место (c: postgres data или что-то в этом роде.)
Другой способ решить эту проблему — изменить регион (язык) вашей операционной системы (Машины). Если вы выбираете, например, французский, возьмите французский из Франции, а не местный французский. То же самое для английского, а не местного английского. Некоторые символы не работают с местным языком. Думаю, это решит вашу проблему.
Для меня это терпело неудачу каждый раз и для каждого решения, упомянутого здесь. Затем, после небольших собственных исследований и разработок, я смог успешно использовать postgresql. Ниже приведены шаги, которые необходимо выполнить при обнаружении этой ошибки «сбой при инициализации кластера базы данных».
Вы должны вручную запустить initdb, который присутствует: «C: Software PostgreSql 12 bin»
Теперь убедитесь, что вы связали «postgres» как пользователя с командой initdb, поскольку «postgres» — это суперпользователь, созданный во время установки.
initdb -D «D: PostgreSql 12 data» -U postgres
Теперь, когда кластер базы данных инициализирован, вы можете запустить сервер с помощью утилиты pg_ctl, находящейся в папке bin PostgreSql 12.
pg_ctl start -D «D: PostgreSql 12 data»
Или вы также можете зарегистрировать его как службу Windows, и вы можете установить его на автоматический
pg_ctl register -N PostgreSql-12.3.1 -D «D: PostgreSql 12 data»
Теперь вы готовы к использованию базы данных postgresql. Либо используйте его через строку cmd (psql), либо pgAdmin4
У меня была такая же ошибка, но с другой основной проблемой (не с разрешениями пользователя, а с проблемой локали). Решение для этого описано здесь: Инициализация кластера базы данных Win 10 Postgresql 11 не удалась
Я пытался и терпел неудачу несколько раз, думая, что это как-то связано с правами и пользователем, которые использовались во время установки. Но благодаря совету ThangLeQuoc по проверке журнала установки я нашел причину:
initdb: недопустимое имя локали «NorwegianBokm † l, Norway»
Вызывается Die (не удалось инициализировать кластер базы данных с помощью initdb) .
Не удалось инициализировать кластер базы данных с помощью initdb
Итак, после выбора «локали по умолчанию» в процессе установки все прошло нормально. Это было в версии 11.6 OS Postgres.
Я выполнил шаги, предложенные @IsoNecroMad, и это сработало
1) Прежде всего, запустите настройку от имени администратора.
2) Выберите папку для установки внутри программных файлов (по умолчанию)
3) Но выберите расположение данных вне указанной выше папки в другое место (c: postgres data или что-то в этом роде.)
Возможное решение для 10.3. версия:
Переместите загруженный файл на диск C: .
Пример: C:postgresql-10.3-2-windows-x64.exe
Создайте каталог с именем PostgreSQL на диске C:
Создайте каталог с именем 10 в ранее созданном каталоге PostgreSQL.
Итак, вам нужно иметь C: PostgreSQL 10 .
Запустите C: postgresql-10.3-2-windows-x64.exe (НЕ НАЖИМАЙТЕ «ЗАПУСТИТЬ ОТ АДМИНИСТРАТОРА», просто дважды щелкните)
Измените путь к каталогу установки на C:PostgreSQL
Измените путь к каталогу данных на C:PostgreSQLdata
Надеюсь, установка пройдет успешно.
Запустите установку от имени администратора и используйте режим Windows 7
Я столкнулся с той же проблемой при попытке установить postgres 10.3. Запуск от имени администратора мне не помог. Но он был установлен правильно, когда я изменил каталог установки с каталога по умолчанию, который находится внутри Program Files. Вместо этого я создал новую папку на диске C и сделал ее каталогом установки.
Я устанавливал Postgres версии 9.5 (в Windows 7 и с помощью установщика DBEnterprise) . для меня проблема, похоже, в том, что я выбирал «POSIX» в качестве региональной конфигурации . Но я пробовал с региональной конфигурацией «C» Настройка и установка завершились без проблем .
Также я запускаю установщик от имени администратора!
Только не используйте установщик EDB. Сейчас есть альтернатива BigSQL.
Сейчас 2019 , и у меня все еще та же проблема с Postgres 11 . Перед этим я удаляю текущий Postgres 9.6 (если я правильно помню версию) и пытаюсь установить новый Postgres 11, и возникает проблема. Я пробовал следующие подходы, но ни один из них не работает:
- Запускать установку от имени администратора при каждом запуске -> сбой
- Выберите папку для установки по умолчанию, предложенную при установке (C: / Program Files / PostgresSQL / 11), и папку данных, расположенную в другом место -> не удалось
- Установить его за пределами C: / -> все равно не удалось
Единственный подход, который я, к счастью, нашел, почесав голову почти весь день, — это сообщение
Я хотел бы быстро резюмировать решение, если срок действия ссылки истек.
Источник
Ошибка файловой системы 1073741515 в Windows 7, Windows 10
Ошибка файловой системы 1073741515 , которая переводится в тип ошибки 0xC0000135 , описывает невозможность запуска исполняемой программы из-за отсутствия необходимых компонентов (одного или нескольких .dll файлы) или неправильно настроенные системные файлы.
Эти неисправные системные файлы или отсутствующие компоненты создают ошибки реестра в вашей операционной системе Windows, которые приводят к сбоям системы, снижению производительности ПК, сбоям программы и многим другим.
Вы можете спросить, что вызывает ошибки реестра?
Ошибки реестра возникают, в основном, когда новые приложения устанавливаются поверх существующих, не удаляя полностью предыдущее приложение и его компоненты.
Что вызывает «Ошибка файловой системы – 1073741515» в окнах 7 и 10?
Ошибка файловой системы – 1073741515 ’может быть вызвана одной из следующих причин:
- Неисправное оборудование
- Ошибки JavaScript
- Ошибки в проводнике Windows
- Вредоносное ПО (вирусы, рекламное и шпионское ПО)
- Ошибки реестра
Каковы симптомы «Ошибка файловой системы – 1073741515»
Симптомы ошибок, с которыми сталкиваются пользователи Win7 или 10:
- Ошибки протокола передачи гипертекста (HTTP)
- Резкие проблемы с отключением
- Синий экран смерти (BSOD)
- Ошибка ввода/вывода (IO)
- .exe файлы не запускаются
- Отключенные средства управления UA
Как исправить ошибку файловой системы 1073741515 в Windows 7, 10
Чтобы исправить ошибку файловой системы 1073741515 на Win7 и 10, выполните действия, перечисленные ниже.
- Используйте RegCure Pro, чтобы автоматически исправить ошибку
- Избавьтесь от шпионских программ, используя утилиту для удаления Spyhunter Malware
- Используйте Windows Repair, чтобы исправить ошибку
- Обновить/Сбросить Windows 10
1. Используйте RegCure Pro, чтобы автоматически исправить ошибку
RegCure Pro – это инструмент для восстановления реестра, который эффективно сканирует и исправляет поврежденные или отсутствующие файлы реестра. Исправляя проблемы с реестром, он также избавляется от «Ошибка файловой системы 1073741515» и предотвращает возникновение других связанных с этим проблем. Чтобы использовать RegCure Pro, следуйте этим инструкциям:
- Скачать RegCure Pro
- Установите программу и запустите ее.
- Нажмите кнопку «Сканировать» и дождитесь ее завершения.
- После завершения сканирования нажмите Исправить ошибки
- Перезагрузите компьютер
- Запустите программное обеспечение, инициирующее Ошибка файловой системы 1073741515, и ошибка должна исчезнуть.
- ОТНОСИТЕЛЬНО: 10 лучших очистителей реестра для Windows 10
2. Избавьтесь от шпионских программ, используя утилиту для удаления Spyhunter Malware
Spyhunter оптимизирует ваш компьютер, удаляя все следы вредоносного, рекламного и шпионского ПО, чтобы обеспечить бесперебойную работу вашего компьютера.
После использования RegCure Pro для устранения проблем, связанных с реестром, выполните быстрое сканирование с помощью средства защиты от вредоносных программ SpyHunter, чтобы убедиться, что « Ошибка файловой системы 1073741515 » больше не возникает.
Чтобы использовать Spyhunter для удаления различных видов шпионских программ, вредоносных программ и вирусов, выполните следующие инструкции по удалению:
- Скачать Spyhunter
- Следуйте инструкциям, чтобы установить его на свой компьютер
- В интерфейсе программного обеспечения защиты от вредоносных программ нажмите кнопку «Сканирование вредоносных программ», чтобы запустить быстрое или полное сканирование системы, и следуйте инструкциям на экране.
- После завершения сканирования системы установите флажок Выбрать все или нажмите Выбрать все , затем нажмите Удалить , чтобы удалить все угрозы на вашем компьютере.
Завершив быстрое сканирование, запустите установленные приложения, средства устранения неполадок Windows и средства администрирования, и теперь все должно работать нормально.
Ошибка файловой системы 1073741515 ’, которую вы испытывали на своей ОС Win7 или Win10 на своем ПК, должна исчезнуть.
3. Используйте Windows Repair, чтобы исправить ошибку
- Загрузите Windows Repair Portable ЗДЕСЬ и распакуйте загруженный файл
- Найдите новую разархивированную папку, созданную в нужном вам месте, и откройте папку с меткой ‘’ files ’’ (… восстановление Windows v… файлы )
- СВЯЗАННЫЕ: исправлено: ошибка 0x80240fff блокирует обновления Windows 10
- В папке файлы найдите fix_exe_hijack.infфайл .
- Нажмите правой кнопкой мыши на файл и выберите Install ’Install’ ’.
- После установки .inf , перезагрузите компьютер, и вы сможете открывать приложения и инструменты администрирования, не сталкиваясь с «сильной ошибкой файловой системы 1073741515. »
- Кроме того, установите файл .exe
- Запустите и перейдите на вкладку Ремонт – главная страница , а затем Предварительные настройки: все ремонтные работы .
- Убедитесь, что установлены все флажки для Все ремонтные работы . Затем нажмите Начать ремонт .
Примечание. Для выполнения ремонта пользователь должен быть администратором .
- Не отменяйте процесс, дождитесь окончания ремонта
- После завершения ремонта вам будет предложено перезагрузить компьютер. Выберите Да .
- При перезапуске компьютера теперь вы сможете открывать приложения и инструменты администрирования, не испытывая ошибки File System 1073741515. ’’.
- СВЯЗАННЫЕ: Как исправить поврежденный реестр в Windows 10, 8, 8.1
4. Обновить/Сбросить Windows 10
Выполнение обновления или перезагрузки ПК в Windows 10 в основном переустановит операционную систему, удалит все сторонние приложения, оставляя все личные данные без изменений. Тем не менее, вы можете выбрать, хотите ли вы сохранить какие-либо данные.
Для обновления ПК в Windows 10 выполните следующие процедуры:
- Удерживая WinKey + S , в поле поиска введите Настройки и нажмите на него.
- Нажмите Обновление и безопасность .
- Выберите Восстановление .
- В разделе «Перезагрузить этот компьютер» нажмите Начало работы , чтобы начать сброс/обновление
- Примите к сведению подсказку по мере ее появления и выберите, сохранять ли ваши личные файлы или удалять их.
- После завершения обновления конфигурации вашего компьютера теперь должны быть установлены по умолчанию и все накопления реестра очищены
- Переустановите ваши приложения и запустите их. Ошибка файловой системы – 1073741515 ’должна быть удалена.
- Кроме того, попробуйте запустить средства администрирования и средства устранения неполадок Windows, теперь все должно работать нормально.
Используя все или некоторые из этих настроек, ошибки протокола передачи гипертекста (HTTP), проблемы с внезапным завершением работы, синий экран смерти (BSOD), ошибка ввода/вывода (IO); Файлы .exe не работают, ошибки реестра и отключенные элементы управления UA должны быть в прошлом.
Источник
Adblock
detector
I’m following these instructions, however I can only get to step 17.2.
Despite installing postgresql successfully via the
sudo apt-get install postgresql
command, upon running
initdb -D /usr/local/pgsql/data
Ubuntu tells me that it ‘initdb’ isn’t installed. The instructions tell me this command is installed by
sudo apt-get install postgresql
so what’s going on? I can make initdb available by installing postgres-xc, but I think postgres-xc is just some weird third party rubbish, and it’s not detailed in the instructions. Any ideas?
asked Nov 5, 2013 at 21:20
You will find initdb
under /usr/lib/postgresql/x.y/bin/
. See also /usr/share/doc/postgresql-common/README.Debian.gz
for more information on the setup on Debian and Ubuntu.
answered Nov 6, 2013 at 2:00
5
initdb
is intended to be run under the postgres user account that is created during the install. After installing postgresql you can do:
sudo su - postgres
Then you should be able to run initdb
.
answered Jan 8, 2014 at 21:44
4
initdb
is not installed as user executable. Is only installed in /usr/lib/postgresql/X.X/bin/
, because it always depends on the version. initdb
can only be executed from that specific directory.
As mentioned in other answers, installation of postgres creates a default directory that may be in a limited partition. Users may want to change this, but it requires other steps also. see here.
answered Jul 14, 2018 at 4:32
ilias iliadisilias iliadis
3011 gold badge2 silver badges9 bronze badges
Follow the following steps with user root
passwd postgres
— your passwordsu postgres
psql
- Create a user with your user name like
CREATE USER SAM ;
create database sam;
- Log out and type
psql <your_user>
answered Jan 16, 2014 at 12:32
smn_onrockssmn_onrocks
5265 silver badges14 bronze badges
1
i was installing postgresql on ubuntu using linuxbrew:
brew install postgresql
it seems to work fine but after that because i was installing PostgreSQL for the first time i tried creating a database:
initdb /usr/local/var/postgres -E utf8
but it returned as:
initdb: command not found
i tried running the command with sudo but that doesn't helped
asked May 22, 2017 at 3:31
run locate initdb
it should give you the list to chose. smth like:
MacBook-Air:~ vao$ locate initdb
/usr/local/Cellar/postgresql/9.5.3/bin/initdb
/usr/local/Cellar/postgresql/9.5.3/share/doc/postgresql/html/app-initdb.html
/usr/local/Cellar/postgresql/9.5.3/share/man/man1/initdb.1
/usr/local/Cellar/postgresql/9.6.1/bin/initdb
/usr/local/Cellar/postgresql/9.6.1/share/doc/postgresql/html/app-initdb.html
/usr/local/Cellar/postgresql/9.6.1/share/man/man1/initdb.1
/usr/local/bin/initdb
/usr/local/share/man/man1/initdb.1
So in my case I want to run
/usr/local/Cellar/postgresql/9.6.1/bin/initdb
If you don’t have mlocate installed, either install it or use
sudo find / -name initdb
answered May 22, 2017 at 7:24
There’s a good answer to a similar question on SuperUser.
In short:
- Postgres groups databases into «clusters», each of which is a named collection of databases sharing a configuration and data location, and running on a single server instance with its own TCP port.
- If you only want a single instance of Postgres, the installation includes a cluster named «main», so you don’t need to run
initdb
to create one. - If you do need multiple clusters, then the Postgres packages for Debian and Ubuntu provide a different command
pg_createcluster
to be used instead ofinitdb
, with the latter not included inPATH
so as to discourage end users from using it directly.
And if you’re just trying to create a database, not a database cluster, use the createdb
command instead.
answered Jul 18, 2017 at 1:33
David ScarlettDavid Scarlett
3,0912 gold badges11 silver badges27 bronze badges
I had the same problem and found the answer here.
Ubuntu path is
/usr/lib/postgresql/9.6/bin/initdb
Edit: Sorry, Ahmed asked about linuxbrew, I’m talking about Ubuntu.
I Hope this answer helps somebody.
answered Feb 1, 2018 at 4:10
I had a similar issue caused by the brew install postgresql
not properly linking postgres. The solve for me was to run:
brew link --overwrite postgresql
answered Aug 25, 2022 at 14:23
elkelkelkelk
1,6922 gold badges13 silver badges20 bronze badges
you can add the PATH to run from any location
sudo nano ~/.profile
inside nano go to the end and add the following
# set PATH so it includes user's private bin if it exists
if [ -d "/usr/lib/postgresql/14/bin/" ] ; then
PATH="/usr/lib/postgresql/14/bin/:$PATH"
fi
and configure the alternative
sudo update-alternatives --install /usr/bin/initdb initdb /usr/lib/postgresql/14/bin/initdb 1
answered Sep 11, 2022 at 13:52
Step 1: I installed PostgreSQL using sudo apt-get install postgresql-9.1
as recommended on the PostgreSQL website
Step 2: I tried to run postgres
. It’s not found. For whatever reason, the install doesn’t appear to add it to the path? So I had to manually add the line export PATH=$PATH:/usr/lib/postgresql/9.1/bin
to the bottom of my ~/.profile
. (Sidenote: Anybody know why this is necessary? Am I doing something wrong with the install? Everything else I’ve installed in Ubuntu «just works» without changing the $PATH
…)
Step 3: I try running initdb /usr/local/var/postgres
. Permission denied. I try running sudo initdb /usr/local/var/postgres
. Result is sudo: initdb: command not found
. How is this command not found? I just ran the damn thing! echo sudo $PATH
shows the PostgreSQL directory in the path… what am I missing?
I’m a bit of a newbie in Linux, but these are the sorts of super-irritating problems I keep running into!
UPDATE: I believe it’s related to this question. However, running the command with sudo -i
does not fix the problem. I just get: -bash: initdb: command not found
. Great.
UPDATE: This seems even closer. So I added alias sudo='sudo env PATH=$PATH'
to my .bashrc
as instructed. Still doesn’t effin’ work! It looks like the alias isn’t working. When I run alias
, I only show a single one. And yet my .bashrc
is full of them… so something is wrong with those getting set up.
UPDATE: Since I’m using Ubuntu and RVM, RVM recommended that I set up the terminal to «Run command as login shell». Based on reading I did here, it seems that the .bashrc
file isn’t read in a login shell, only profile. So I moved the alias
line from .bashrc
to .profile
, so .profile
now has this at the end:
export PATH="/usr/lib/postgresql/9.1/bin:$PATH"
alias sudo='sudo env PATH=$PATH'
… and it still doesn’t work. Running alias
only shows an RVM alias, but not the sudo
alias I tried to set up.
UPDATE From this site, I read about the precedence of dotfiles. It looks like .bash_profile
comes before .profile
. That being said, my PATH
additions were done in .profile
, and seemed to be loaded just fine, so why wasn’t the alias
also working? Moving the alias
into .bash_profile
from .profile
worked, however. Mystery. So then the alias
command shows my new alias. I finally type in sudo initdb /usr/local/var/postgres
, to be met with: initdb: cannot be run as root
. Oh, really? Then why were you giving me permission errors?! So now I think the problem is that I just have to chown
the folder, but still run initdb
as my user rather than root
.
UPDATE Running the command sudo chown myuser /usr/local/var/postgres/
, and then running initdb
afterward allowed the database to be initialized. Glad it was so obvious that the directory permissions needed to be set to myuser and not root. Incredible. Successful database init 4 hours later.
(Note: This question has been compeltely rewritten from its original form, so it reflects the actual problem and will help others find a solution to the same issue).
I still haven’t been able to successfully install PostgreSQL on my Windows 7 Ultimate x64 computer. See this prior question for some history.
I did a fresh instillation of 9.2 and the only error I got was this one:
It reads:
«Problem running post-install step. Installation may not complete
correctly. The database cluster initialisation failed».
This occurs even after I do a complete manual uninstall of PostgreSQL and pgAmdin-III:
- Ran the PostgreSQL uninstaller, which failed with the error
Error stopping service postgresql-x64-9.2
. - Removed all the PostgreSQL-related registry entries for PostgreSQL under
HKEY_LOCAL_MACHINESOFTWARE
andHKEY_CURRENT_USERSOFTWARE
- Removed the
postgres
user account usingnet user postgres /delete
in an Administrator command prompt (shift-right clicked on «Command Prompt» in start menu, chose «Run as administrator») - Removed the
postgres
user profile - Deleted the
C:Program FilesPostgreSQL
directory, including the data directory within %appdata% - Removed some PgAdmin-III registry entries that pointed to PostgreSQL
- Removed the service account for postgres from
services.msc
When I reboot and try the installer again it fails with the same message.
The install-postgresql.log
file from %TEMP%
contains:
Executing cscript //NoLogo "C:Program FilesPostgreSQL9.2/installer/server/initcluster.vbs" "NT AUTHORITYNetworkService" "postgres" "****" "C:Program FilesPostgreSQL9.2" "C:Program FilesPostgreSQL9.2data" 5432 "DEFAULT"
Script exit code: 1
then another error a bit later:
creating template1 database in C:/Program Files/PostgreSQL/9.2/data/base/1 ... initdb: could not execute command ""C:/Program Files/PostgreSQL/9.2/bin/postgres.exe" --boot -x1 -F ": No error
See full installer log file download here.
asked Nov 17, 2012 at 1:08
1
It appears that the root cause of this issue may have been that @Celeritas’s computer had an incorrect value for the COMSPEC
environment variable. It had a trailing semicolon, so instead of the normal:
C:Windowssystem32cmd.exe
it was:
C:Windowssystem32cmd.exe;
This one-character difference is enough. The above isn’t a valid command prompt path, so popen()
calls were failing. Unfortunately, instead of something useful like:
'"C:Windowssystem32cmd.exe;"' is not recognized as an internal or external command, operable program or batch file
it instead reports the delightfully useful error No error
:
initdb: could not execute command ""C:/Program Files/PostgreSQL/9.2/bin/postgres.exe" --boot -x1 -F ": No error
See related:
- http://forums.enterprisedb.com/posts/list/2125.page
- http://postgresql.1045698.n5.nabble.com/initdb-failure-td2083455.html
I’ve reported this to the installer team and written a wiki entry to describe it. See blog post.
The issue was eventually resolved by:
- Editing the
COMSPEC
environment variable - Uninstalling PostgreSQL
- Rebooting
- Reinstalling PostgreSQL
though there was a lot more before that which shouldn’t actually be necessary to resolve this, including doing a total manual clean uninstall of PostgreSQL by hand.
Now I just want to find the people who wrote the program that modified this environment variable.
answered Nov 19, 2012 at 4:17
Craig RingerCraig Ringer
53.8k3 gold badges147 silver badges185 bronze badges
1
from this answer https://dba.stackexchange.com/a/248584/185153
If you’re on Windows 10 with codepage UTF-8 in regional settings (picture in link above), the root cause is that :
- Cluster initialization in setup calls
initdb
initdb
checks version as if callingpostgres -V
postgres -V
doesn’t recogniseCPutf8
yet then returns an unmatched result.
Until it is properly fixed, you may just uncheck UTF-8 codepage box and restart, it will be okey.
This can reproduced in PostgreSQL 12 also.
Kudos to @simon for this finding.
answered Oct 27, 2019 at 7:22
Struggling with this problem for days.Finally got help from the EDB team
My problem got solved by doing the following steps :
1) Open the command prompt and go to the following directory.
cd «C:Program FilesPostgreSQL10bin»
2) Once you are inside the «C:Program FilesPostgreSQL10bin» directory execute the following command.
.initdb.exe -D «C:Program FilesPostgreSQL10data»
3) At the end of this command you will be promoted to execute a pg_ctl command to start the Postgres cluster. Please execute the command and once you get a message as the server started you are all set to use the Postgres database.
Note : Instead of 10 user whatever version you have installed .If the pg_ctl command in the third step gives an error after running it in bin directory , then try running it in data directory.After the above process re-run the installer.
answered May 27, 2020 at 20:22
6
Problem:
Installing 13.1.1 on Windows Server 2019 failed with the message
«Problem running post-install step. Installation may not complete
correctly. The database cluster initialisation failed».
-
My COMSPEC environment variable was configured correctly.
-
My UTF-8
codepage setting was disabled. -
Manually envoking initdb failed with the following:
PS C:Program FilesPostgreSQL13bin> .initdb.exe -D "D:PostgreSQL" The files belonging to this database system will be owned by user "myUser". This user must also own the server process. The database cluster will be initialized with locale "English_United States.1252". The default database encoding has accordingly been set to "WIN1252". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory D:/PostgreSQL ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... windows selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... US/Eastern creating configuration files ... ok running bootstrap script ... 2021-01-25 09:55:49.793 EST [51184] LOG: unrecognized win32 error code: 50 2021-01-25 09:55:49.804 EST [51184] LOG: could not link file "pg_wal/xlogtemp.51184" to "pg_wal/000000010000000000000001": Invalid argument 2021-01-25 09:55:49.808 EST [51184] FATAL: could not open file "pg_wal/000000010000000000000001": No such file or directory child process exited with exit code 1 initdb: removing contents of data directory "D:/PostgreSQL"
Probable cause:
Drive D: is formatted using ReFS. Initializing on an NTFS drive worked without issue.
Solution:
Initialize the database on drive C:PostgreSQL and then copy folder to D:PostgreSQL.
Open terminal as normal user (not admin) and run:
C:UsersmyUser>"C:Program FilesPostgreSQL13binpg_ctl.exe" -D "D:PostgreSQL" -l logfile start
waiting for server to start.... done
server started
Launch a psql shell and login with user myUser. You can then create a postgres user if desired:
CREATE ROLE postgres LOGIN PASSWORD 'password' NOINHERIT CREATEDB;
CREATE SCHEMA postgres AUTHORIZATION postgres;
GRANT USAGE ON SCHEMA postgres TO PUBLIC;
answered Jan 25, 2021 at 15:38
For people still struggleing with this in 2022. The only thing that worked for me on Windows 10 is selecting English America as the local rather then my own latin locale.
answered Jan 19, 2022 at 10:02