Install and configure the PostgreSQL server in the Ubuntu system

Source: Internet
Author: User
Keywords installation server very
Tags advanced advanced features aliyun client configure database management database management system etc

PostgreSQL is a powerful relational database management system that is issued under BSD license [1]. PostgreSQL contains a number of advanced features, with good performance and good applicability. PostgreSQL binds a number of programming languages, such as C + +, Python, Java, PHP, http://www.aliyun.com/zixun/aggregation/13430.html ">ruby," etc. It can operate many things, from simple Web applications to huge databases with millions of of records.

Installation

You can use the command line to install PostgreSQL and enter:

sudo apt install PostgreSQL

Pgadmin III is a convenient PostgreSQL graphics client, it is suitable for beginners, you can enter the following command in the terminal to install:

sudo apt install pgadmin3

You can also install these packages through System-> System Management-> The new Riser Pack manager.

Start

sudo/etc/init.d/postgresql-8.4 start

sudo/etc/init.d/postgresql-8.4 stop

Set Password

Installation is complete, we need to change the Postgres user's password, otherwise we cannot use this database server. Run the Psql command as Postgres This system user, and enter the following in the terminal:

sudo su postgres-c psql template1

A new prompt will appear with the following two commands, replacing <***PASSWORD***> with the new password:

ALTER USER postgres with PASSWORD ' <***password***> ';

Creating a Database

To create the first database, we name it "MyDB" and enter:

sudo su postgres-c createdb mydb

Using the Pgadmin III graphical interface client

To understand what PostgreSQL can do, you first need to learn to use a graphical interface of the client, in the terminal input:

Pgadmin3

You are now stuck in the main interface of Pgadmin III, click on the "Add Database Connection" button (above left). Pop up a new dialog box, enter address 127.0.0.1, server description, default database "MyDB" and your password.

With this graphical interface, you can create new databases, tables, and other objects, query the database, add data, execute SQL statements, and so on. Connect with Pgadmin 3

Effect chart

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.