Ubuntu Server Guide
Download 1.23 Mb. Pdf ko'rish
|
ubuntu-server-guide (1)
- Bu sahifa navigatsiya:
- Installation
- Configuration
Resources
• See the MySQL Home Page for more information. • Full documentation is available in both online and offline formats from the MySQL Developers portal • For general SQL information see the O’Reilly books Getting Started with SQL: A Hands-On Approach for Beginners by Thomas Nield as an entry point and SQL in a Nutshell as a quick reference. • The Apache MySQL PHP Ubuntu Wiki page also has useful information. 133 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. Installation To install PostgreSQL, run the following command in the command prompt: sudo apt i n s t a l l p o s t g r e s q l The database service is automatically configured with viable defaults, but can be customized based on your specialized needs. Configuration PostgreSQL supports multiple client authentication methods. By default, the IDENT authentication method is used for postgres and local users. Please refer to the PostgreSQL Administrator’s Guide if you would like to configure alternatives like Kerberos. 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 /etc/postgresql/ directory. For example, if you install PostgreSQL 12, the configuration files are stored in the /etc/postgresql /12/main directory. Tip To configure IDENT authentication, add entries to the /etc/postgresql/12/main/pg_ident.conf file. There are detailed comments in the file to guide you. To enable other computers to connect to your PostgreSQL server, edit the file /etc/postgresql/12/main/ postgresql.conf Locate the line #listen_addresses = ‘localhost’ and change it to: l i s t e n _ a d d r e s s e s = ’ * ’ Note To allow both IPv4 and IPv6 connections replace ‘localhost’ with ‘::’ For details on other parameters, refer to the configuration file or to the PostgreSQL documentation for information on how they can be edited. 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 p o s t g r e s p s q l t e m p l a t e 1 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 p o s t g r e s with e n c r y p t e d password ’ your_password ’ ; After configuring the password, edit the file /etc/postgresql/12/main/pg_hba.conf to use MD5 authentica- tion with the postgres user: l o c a l a l l p o s t g r e s md5 134 Finally, you should restart the PostgreSQL service to initialize the new configuration. From a terminal prompt enter the following to restart PostgreSQL: sudo s y s t e m c t l r e s t a r t p o s t g r e s q l . s e r v i c e Warning The above configuration is not complete by any means. Please refer to the PostgreSQL Admin- istrator’s Guide to configure more parameters. You can test server connections from other machines by using the PostgreSQL client. sudo apt i n s t a l l p o s t g r e s q l −c l i e n t p s q l −h p o s t g r e s . example . com −U p o s t g r e s −W Download 1.23 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling