Setting up PostgreSQL, could not connect to database postgres

萝らか妹 提交于 2020-01-05 09:07:22

问题


I will create a django app on Debian 7 with postgreSQL 9.2. I created a droplet in digital ocean. I updated and upgraded the system. I used the following command

sudo aptitude install postgresql postgresql-contrib

to install postgresql.

When I changed user to postgres and I wanted to create a new db user with createuser -P

I filled all the fields it wanted but it came up with this error:

createuser: could not connect to database postgres: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I tried same process a few times with new droplets in Ubuntu 12.04 and Debian 7.

What should I do? I want to use Debian 7, so I prefer solutions with Debian. I am new at this stuff so be explanatory please. Thanks.


回答1:


I figured it out with fixing locale problem and reinstall PostgreSQL

First: http://perlgeek.de/en/article/set-up-a-clean-utf8-environment

Second: How to thoroughly purge and reinstall postgresql on ubuntu?

Set up the locale and make a clean installation for postgreSQL.

Thanks!



来源:https://stackoverflow.com/questions/24389233/setting-up-postgresql-could-not-connect-to-database-postgres

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!