DERNIÈRE MISE À JOUR:
J'ai oublié de lancer la commande initdb....
< /DERNIÈRE MISE À JOUR>
en exécutant cette commande
ps auxwww | grep postgres
je vois que postgres est pas en cours d'exécution
> ps auxwww | grep postgres
remcat 1789 0.0 0.0 2434892 480 s000 R+ 11:28PM 0:00.00 grep postgres
cela soulève la question:
Comment puis-je démarrer le serveur postgresql?
mise à jour:
>pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
sh: /usr/local/var/postgres/server.log: No such file or directory
update2:
Le tactile n'a pas réussi donc j'ai fait ceci à la place:
> mkdir /usr/local/var/postgres
> vi /usr/local/var/postgres/server.log
> ls /usr/local/var/postgres/
server.log
mais quand j'essaie de démarrer le serveur rails, je vois encore ce:
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
update3:
> pg_ctl -D /usr/local/var/postgres status
pg_ctl: no server running
update4:
J'ai trouvé qu'il n'y A PAS de pg_hba.conf (seulement pg_hba.conf.de l'échantillon) j'ai donc modifié l'échantillon et l'a renommé (pour enlever l' .de l'échantillon). voici le contenu:
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
mais je ne comprends pas ceci:
> pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
> pg_ctl -D /usr/local/var/postgres status
pg_ctl: no server running
aussi:
sudo find / -name postgresql.conf
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
update5:
sudo pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Password:
pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.
update6:
ce qui semble étrange:
> egrep 'listen|port' /usr/local/var/postgres/postgresql.conf
egrep: /usr/local/var/postgres/postgresql.conf: No such file or directory
cependant, j'ai fait ceci:
>sudo find / -name "*postgresql.conf*"
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample
/usr/share/postgresql/postgresql.conf.sample
j'ai donc fait ceci:
egrep 'listen|port' /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample
#listen_addresses = 'localhost' # what IP address(es) to listen on;
#port = 5432 # (change requires restart)
# supported by the operating system:
# %r = remote host and port
j'ai donc essayé ceci:
> cp /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf
> cp /usr/share/postgresql/postgresql.conf.sample /usr/share/postgresql/postgresql.conf
toujours la même chose "le serveur Est en cours d'exécution?"....