PostgreSQL
PostgreSQL is an object-relational database system that has the features of traditional commercial database systems with enhancements to be found in next-generation DBMS systems. InstallationTo install PostgreSQL,run the following command in the command prompt: sudo apt-get install postgresql
Once the installation is complete,you should configure the PostgreSQL server based on your needs,although the default configuration is viable. ConfigurationBy default,connection via TCP/IP is disabled. PostgreSQL supports multiple client authentication methods. By default,IDENT authentication method is used for postgres and local users. Please refer the PostgreSQL Administrator's Guide. The following discussion assumes that you wish to enable TCP/IP connections and use the MD5 method for client authentication. PostgreSQL configuration files are stored in the
To enable TCP/IP connections,edit the file Locate the line #listen_addresses = 'localhost' and change it to: listen_addresses = 'localhost'
You may also edit all other parameters,if you know what you are doing! For details,refer to the configuration file or to the PostgreSQL documentation. Now that we can connect to our PostgreSQL server,the next step is to set a password for the postgres user. Run the following command at a terminal prompt to connect to the default PostgreSQL template database: sudo -u postgres psql template1
The above command connects to PostgreSQL database template1 as user postgres. Once you connect to the PostgreSQL server,you will be at a SQL prompt. You can run the following SQL command at the psql prompt to configure the password for the user postgres. ALTER USER postgres with encrypted password 'your_password';
After configuring the password,edit the file local all postgres md5 Finally,you should restart the PostgreSQL service to initialize the new configuration. From a terminal prompt enter the following to restart PostgreSQL: sudo /etc/init.d/postgresql-8.4 restart
Resources
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |