Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of postgresql installation in Ubuntu

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you a sample analysis of postgresql installation problems in Ubuntu, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Installation of Ubuntu postgresql

I personally tested the Ubuntu postgresql version 8.3 installed on ubuntu9.10. Depressed for several days, finally ok. Sudo apt-get install postgresql-8.3 postgresql-client-8.3 postgresql-contrib-8.3

Then add it to / etc/profile

Export POSTGRES_HOME=/usr/lib/postgresql/8.3

Export PGLIB=$POSTGRES_HOME/lib

Export PGDATA=$POSTGRES_HOME/database

Export MANPATH=$MANPATH:$POSTGRES_HOME/man

Export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PGLIB

At the terminal source / etc/profile

Then switch to postgres user sudo su postgres

Start the database engine. / initdb-D $PGDATA

Start the database pg_ctl start-l logfile

The server is started in the background and the output is placed in the specified log file. The-D option has the same meaning as when you run postmaster directly. Pg_ctl can also be used to shut down the server.

Note that you need to switch back to globus user su globus at this time.

The next step is to set the database user and permissions. The first step is to get a Shell of the superuser postgres, which can be obtained here in the following ways:

$sudo-u postgres sh creates a database user in this Shell that is the same as your user. Here I use globus, because this is also the user name I logged in to Ubuntu

$createuser-A-D-P globus then creates a database for this user. Here I'll take mydb as an example

Createdb-O globus mydb note that the above operations are done in the Shell of the user postgres, and then exit the user's Shell environment and enter the user's Shell.

$exit now uses globus users, and you can connect to your mydb database with the following command. $psql mydb exits / Q and you can install pgadmin3 graphical management Ubuntu postgresql at the same time

The above is all the contents of the article "sample Analysis of postgresql installation problems in Ubuntu". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report