VPS 및 전용 서버(호스팅 컨트롤 센터) 도움말

How to install PostgreSQL on CentOS

Maybe you've seen one of the articles out there comparing PostgreSQL, MySQL and other database architectures, and you want to compare things yourself. Or maybe you know you're using PostgreSQL for a project. Either way, you need to get the server up and running. Here's how to get a PostgreSQL server started on top of CentOS.

DIFFICULTY Basic - 1 | Medium - 2 | Advanced - 3
TIME REQUIRED 15 min
RELATED PRODUCTS CentOS-based VPS or dedicated servers

RECIPE

Install PostgreSQL

yum install postgresql postgresql-contrib

Install the server

yum install postgresql-server

Initialize the database

service postgresql initdb

The system should return "Initializing database [ok]."

Check the configuration and start the service

chkconfig postgresql on
service postgresql start

PostgreSQL creates a user called "postgres" which accesses the database functions. You'll need to switch to that user to make sure things are all up and running correctly.

su - postgres

You should now be logged in as the postgres user.

Connect to the database

psql

You should now be at a PostgreSQL prompt which looks like this "postgres=#"

Success!

If you've gotten to the prompt above, PostgreSQL is up and running successfully. You can type \q to quit out of the PostgreSQL prompt

Note: As a courtesy, we provide information about how to use certain third-party products, but we do not endorse or directly support third-party products and we are not responsible for the functions or reliability of such products. Third-party marks and logos are registered trademarks of their respective owners. All rights reserved.


이 글이 도움되었나요?
피드백을 보내주셔서 감사합니다. 고객 서비스 담당자에게 문의하시려면 지원 전화 번호 또는 위의 채팅 옵션을 이용하시기 바랍니다.
도와드릴 수 있어 기쁩니다! 더 도와 드릴 것이 있나요?
그것 유감스럽습니다. 혼동이 되었던 사항 또는 솔루션이 고객님의 문제를 해결하지 못했던 원인을 알려주세요.