Notes on Postgresql backup

Source: Internet
Author: User

The postgresql installed on the server has not been used for a long time. It is actually used for redmine databases. Considering that mysql may be upgraded frequently, and the connection component of rails is a little difficult to install, it was originally installed as postgresql.

Prepare to back up the file today. The phppgadmin command is used. At the beginning, it prompts that the pg_dump execution path is not configured. After reconfiguration, the exported file is empty and corrupted. So I figured it out. I 'd like to go to the installation directory of pg and execute pg_dump.

The server was installed with CentOS 6.2. I forgot to create a user named postgres. if postgres is used for installation, other users cannot switch to bin/pg_dump in the installation directory of pg, prompting them to generate an export file under the specified target. Therefore, it is assumed that the permission of the postgres user is insufficient!

Cat/etc/passwd: How many users are there, postgres. postgres, and how many passwords are there? Forgot! If there is root, directly change passwd to the new password. Then the password of the user is changed immediately and can be correctly switched to postgres. You also need to specify a directory for postgres to have operation permissions.

Chown-R postgres. postgres/var/xxxx

Then return to the bin directory of pg and execute pg_dump redmine>/var/xxx/redmine. bak.

This is finally normal. Don't forget to back up the files folder under the redmine installation directory.

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.