Nasıl mac os x üzerinde MySQL sunucusu başlatmak için?
SON GÜNCELLEME:
İnitdb komutu çalıştırmak için unuttum.
&; /lt SON GÜNCELLEME>
bu komutu çalıştırarak
ps auxwww | grep postgres
PostgreSQL çalışır durumda olduğunu görüyorum
> ps auxwww | grep postgres
remcat 1789 0.0 0.0 2434892 480 s000 R 11:28PM 0:00.00 grep postgres
bu soruyu akla getiriyor: Nasıl postgresql sunucusu başlayacağım?
güncelleme:
>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
güncelleme 2:
Touch yerine bunu yaptım o kadar başarılı değil
> mkdir /usr/local/var/postgres
> vi /usr/local/var/postgres/server.log
> ls /usr/local/var/postgres/
server.log
Ama raylar sunucu başlatmaya çalıştığımda, ben de:
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
güncelleme 3:
> pg_ctl -D /usr/local/var/postgres status
pg_ctl: no server running
güncelleme 4:
Pg_hba olmadığını fark ettim.conf (sadece pg_hba.conf.örnek ve yeniden düzenledim o yüzden örnek) (çıkarmak için .örnek). Burada içeriği:
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
ama bunu anlamıyorum:
> 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
ayrıca:
sudo find / -name postgresql.conf
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
güncelleme 5:
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.
güncelleme 6:
bu garip görünüyor:
> egrep 'listen|port' /usr/local/var/postgres/postgresql.conf
egrep: /usr/local/var/postgres/postgresql.conf: No such file or directory
ama, bunu ben yaptım:
>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
bu şekilde yaptım:
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
yani bu çalıştı:
> 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
hala aynı "server çalışıyor" mesajı.
CEVAP
Homebrew Paket Yöneticisi otomatik olarak başlatmak için launchctl plists içerir. Daha fazla bilgi için brew info postgres
çalıştırın.
El ile başlatın:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
El ile durdurun:
pg_ctl -D /usr/local/var/postgres stop -s -m fast
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
sonucu ne oldu?
pg_ctl -D /usr/local/var/postgres status
sonucu ne oldu?
Sunucuda herhangi bir hata mesajı var.günlük?
Tcp localhost bağlantıları pg_hba etkin olduğundan emin olun.conf:
# IPv4 local connections:
host all all 127.0.0.1/32 trust
Postgresql içinde listen_addresses ve bağlantı noktasını kontrol edin.conf:
egrep 'listen|port' /usr/local/var/postgres/postgresql.conf
#listen_addresses = 'localhost' # what IP address(es) to listen on;
#port = 5432 # (change requires restart)
Temizlik
İsimHomebrew, Fink, MacPorts ya EnterpriseDB yükleyici ile yüklü büyük ihtimalle.
Aşağıdaki komutların çıktısı ile yüklü olduğunu belirlemek için kontrol edin:
brew && brew list|grep postgres
fink && fink list|grep postgres
port && port installed|grep postgres
Nasıl son sorguları MySQL üzerinde yür...
Nasıl Heroku üzerinde raylar sunucu ye...
Nasıl bir iPhone üzerinde ilk kez uygu...
Nasıl Mac OS X üzerinde MySQLdb (Pytho...
Port MySQL üzerinde çalışan bir test i...