Iv. PostgreSQL/PostgisInstall
Some figures have not been cut down. I have already downloaded them in FreeBSD. In fact, read the installation instructions of the software, which is very simple.
Log on to the http://www.postgresql.org and download the latest PostgreSQL database. This installation file already contains postgis (Must download version 8.2 or later, Do not download version 8.1, tested version 8.1 for data backup and recovery problems, the primary key of the data table cannot be restored correctly when the backup data is restored ).
Start Installation
First, select the language used during the installation process. If the Chinese language is not found, you have to select the English language that you can still understand. In addition, you can select the following options to write the detailed installation log to the current installation directory for troubleshooting. You can also read the installation process.
Select the installation Language
Click Next to select the installation content options, which are divided into four parts: database server, user interface, database driver, and development module. You can choose to install as needed. In addition, note that "data transmission.
Note: If you prefer to use a graphical interface to manage and operate databases, you can choose to install pgadminiii on the user interface. Postgis spatial extension provides PostgreSQL with GIS support (postgis), which must be installed here.
Select installation Option 1
Select installation option 2
The next step is service configuration. You can run the database server as a Windows system service, which is also a manifestation of postgresql's true support for Windows installation (for example ).
Select install as a service
Set the service name and the Windows account that runs the service. You can enter an existing account or an existing account to allow the installer to automatically create this account.
Automatically create an account
After creating an account, you must configure the database listening port, connection license, and local region and super user settings. I chose "People's Republic of China" and set the encoding type to UTF-8 (Note: The SQL _ascii must be changed). The super account created here is a database administrator user, note the difference from the previous service account. Note that this dialog box appears only when PostgreSQL is selected as a system service in the previous step.
Initialize database settings
After you click "Next", a remote connection option will pop up, prompting that the local database connection is acceptable by default. However, if you want the remote computer to connect to the database as well, after installation, set the pg_cmd.conf file separately. The specific settings are described later.
Select the process language activated in the default created Test Database template1. Here I only select pgsql. Note that this dialog box appears only when PostgreSQL is selected to run as a system service and the database component is initialized.
Select a process Language
Select the activated modules in the test database template1. All the extension files will be installed. This step only selects which modules will be activated by default in all your databases. These extension modules provide some enhanced functions. (The default value is enough)
Select to load the extension module
So far, the installation and configuration parameters have been configured. You only need to wait for the next step to complete the installation. The PostgreSQL installation speed is very fast and varies slightly according to the time of the machine. The installation successful page is displayed.
Client connection settings
PostgreSQL rejects connections from all remote clients by default for security reasons. If you want to remotely log on to the server, you need to set pg_assist.conf, choose Start> program> PostgreSQL> configuration files to edit pg_cmd.conf.
Edit pg_cmd.conf
Modify to the following content:
# IPv4 local connections:
Host All all 127.0.0.1/32 MD5
Host All all 192.168.1.113/32 MD5
This means that the host and 192.168.1.113 can connect to the database through an MD5 encrypted password. By modifying the IP address mask, you can also allow the IP address segment to connect to the server. In addition, the authentication method MD5 can also be changed to trust, indicating that the connection to this address is fully trusted (this is more convenient when debugging the program ). Change to password, indicating that the password is connected by the password, but the password is sent in plaintext. After the configuration is complete, you need to restart PostgreSQL to take effect.