How to install PostgreSQL database on opensuse

Source: Internet
Author: User
Tags psql

This article describes how to install the PostgreSQL database in opensuse. Let's take a look at the installation steps through the following introduction!

Environment

I tested the installation of postgresql 8.4.6 on opensuse 11.3, and the installation of postgresql 9.0.3 on opensuse 11.4. The steps are no different.

Install

 
 
  1. zypper install postgresql-server 

Initialization

 
 
  1. Mkdir/usr/local/pgsql
  2.  
  3. Mkdir/usr/local/pgsql/Data
  4.  
  5. Chown Postgres/usr/local/pgsql/Data
  6.  
  7. Initdb-D/usr/local/pgsql/data (this should be executed by the S user)

Enable Service

 
 
  1. Postgres-D/usr/local/pgsql/data or pg_ctl-D/usr/local/pgsql/data-l logfile start

Create databases and users

 
 
  1. psql postgres  
  2.  
  3. create user pub password 'pub';  
  4.  
  5. create database pgsql1 owner pub; 

Log on with a new user

 
 
  1. psql -U pub pgsql1  
  2.  
  3. create schema pub authorization pub; 

If it is accessed on the local machine, you can. However, if you want to access PostgreSQL on another host, you need to configure the following.

Configure Network Access

1. If the firewall is enabled, add the postgresql service to the allowed service list.

2. Listen for all access requests. Modify/usr/local/pgsql/data/PostgreSQL. conf and change the localhost to *: listen_addresses = '*'.

3. Set accessible IP addresses. 0 is a wildcard. Modify/usr/local/pgsql/data/pg_assist.conf and add host all 0.0.0.0 0.0.0.0 trust to the last line.

This article describes how to install the PostgreSQL database on opensuse. I hope this introduction will bring you some benefits.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.