Mac OS X 에 PostgreSQL 설치 하기

1011 단어 cOSvimPostgreSQLidea
install
sudo port install postgresql84 postgresql84-server

launch at startup
sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql84-server.plist

To create a database instance
sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
 sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb
 sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'

start the database server using:
sudo -u postgres /opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb
sudo -u postgres /opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/db/postgresql84/defaultdb -l logfile start
better start ,'vim /etc/profile' or 'vim ~/.profile' ,and append 'export PATH=/opt/local/lib/postgresql84/bin/:$PATH'

좋은 웹페이지 즐겨찾기