PostgreSQL Management Tools Phppgadmin Introductory Guide _postgresql

Source: Internet
Author: User
Tags bz2 postgresql safe mode

I. Installation of Phppgadmin
Unzip the downloaded compressed package

For tar.gz, execute the following command:

Copy Code code as follows:
Gunzip phppgadmin-*.tar.gz
TAR-XVF Phppgadmin-*.tar

For TAR.BZ2, execute the following command:

Copy Code code as follows:
BUNZIP2 phppgadmin-*.tar.bz2
TAR-XVF Phppgadmin-*.tar

Execute the following command for. Zip:

Copy Code code as follows:
Unzip Phppgadmin-*.zip

Second, configure Phppgadmin

Edit phppgadmin/conf/config.inc.php File

If you mess up the configuration file, you can use the Config.inc.php-dist file for recovery.

Iii. Creating a Reports Database

If you want to enable reports (a very useful feature), go to the ' SQL ' subdirectory to see the Reports-pgsql.sql script.
It contains instructions on how to create a reports database.

The function of the dump is related

If you are running PHP in safe mode, in order for the database dump to work correctly,
You must include the php.ini ' safe_mode_allowed_env_vars ' instructions in the Pgpassword and pguser environment variables,
You also need to include the directory where the Pg_dump binaries are located in the ' safe_mode_exec_dir ' directive.
For example:

Copy Code code as follows:
Safe_mode_allowed_env_vars = PHP_,PG
Safe_mode_exec_dir =/usr/bin

Generally, you don't want all the programs in/usr/bin to be executed,
So you might want to copy pg_dump and Pg_dumpall to a separate directory.

Similarly, if you want Phppgadmin to support dumps,
You also need to make sure that pg_dump and Pg_dumpall can be executed by the process running PHP.

Finally, if you run Phppgadmin in safe mode,
Long-running imports, exports, and transactions may exit due to timeouts.

V. PostgreSQL Statistics Collector

If the PostgreSQL Statistics program (statistics Collector) is enabled,
Phppgadmin will display table and index performance and usage statistics.
To enable this feature, you need to cancel the comment for the following line in the postgresql.conf file:

Copy Code code as follows:

Stats_start_collector = True
Stats_command_string = True
Stats_block_level = True
Stats_row_level = True

Six, cookies related

In order to be able to use phppgadmin normally in the browser, you must enable the browser's Cookies function.

Vii. important-Security-related

PostgreSQL does not require a password to log on by default,
We strongly recommend that you configure the pg_hba.conf to use MD5 passwords for local links.
and set a password for the default superuser.

Because there are a large number of installed phppgadmin and no password is set for the local area connection,
We provide a configuration option named ' Extra_login_security ', which defaults to TRUE.
This means that you cannot use ' root ', ' Administrator ', ' pgsql ', ' postgres ' user or an empty password to log in.

' Extra_login_security ' can be set to Fasle only after you have made sufficient security settings for the database.
This will enable you to log in as an administrator using the admin password.

Eight tips

When you set display_errors = On in php.ini and the error_reporting contains errors other than the error level,
Phppgadmin often cannot be used smoothly, because the encoding is not strictly in accordance with the coding style expected by PHP developers.
So if there are some problems, try display_errors = off to see, maybe solve some annoying problems in use.

Related Article

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.