Be hcmcloud database backup and process settings.

 Importing databases and simple setup.

Recently we conducted a simple job database backup: 

the Create Database hcmcloud the Create the User HCM with password
' Test6530 ' perform recovery process
psql -U hcm -h 127.0.0.1 -d hcmcloud -W -p 5866 -f /root/hb.sql> /root/hcmcloud.txt then grant all on database hcmcloud to hcm implementation of the empowerment process.

It is not clear there is no problem.

Reprint a website about empowerment, pg own deployment also need to continue to learn

 

https://blog.csdn.net/qq_38102203/article/details/80568047

 

When you create objects in the database, it is assigned owner. Owner usually execute user-created statement. For most types of objects, the initial state is only the owner (or a superuser) can modify or delete objects. To allow other roles or users use it, you must grant permission or authority.
Different types of permissions in PostgreSQL are:
  • SELECT,INSERT,UPDATE,DELETE,TRUNCATE,REFERENCES,TRIGGER,CREATE,CONNECT,TEMPORARY,EXECUTE 和 USAGE。
Depending on the type (table, function, etc.) of an object, the rights to the object. To assign user rights, use the GRANT command.
GRANT syntax
GRANT basic syntax of the command is as follows:
GRANT privilege [, ...]ON object [, ...]TO { PUBLIC | GROUP group | username }
 
  • privilege value may be: SELECT, INSERT, UPDATE, DELETE, RULE, ALL.
  • object: the name of the object to which access is granted. Possible objects are: tables, views, sequences
  • PUBLIC: Short form of representation for all users.
  • GROUP group: granting permissions.
  • username: name of the user to grant permission. PUBLIC is a short form for all users.
REVOKE syntax
REVOKE basic syntax of the command is as follows:
REVOKE privilege [, ...]ON object [, ...]FROM { PUBLIC | GROUP groupname | username }
 
  • privilege value may be: SELECT, INSERT, UPDATE, DELETE, RULE, ALL.
  • object: Name granted access to the object. Possible objects are: tables, views, sequences.
  • PUBLIC: Short form of representation for all users.
  • GROUP group: granting permissions.
  • username: name of the user to grant permission. PUBLIC is a short form for all users.
Examples
To understand the permissions, we start by creating a USER, as follows:
yiibai_db=# CREATE USER manisha WITH PASSWORD 'password';CREATE ROLE
 
CREATE ROLE statement represents the creation of a user named manisha.
Consider COMPANY table has the following records:
yiibai_db# select * from COMPANY; id | name | age | address | salary----+-------+-----+-----------+-------- 1 | Paul | 32 | California| 20000 2 | Allen | 25 | Texas | 15000 3 | Teddy | 23 | Norway | 20000 4 | Mark | 25 | Rich-Mond | 65000 5 | David | 27 | Texas | 85000 6 | Kim | 22 | South-Hall| 45000 7 | James | 24 | Houston | 10000(7 rows)
 
Next, let us give users "manisha" grant all privileges on the table COMPANY, as follows:
yiibai_db=# GRANT ALL ON COMPANY TO manisha;GRANT
 
GRANT statement indicates all privileges on the table COMPANY is assigned to the user "manisha".
Next, let us revoke privileges from user "manisha", as follows:
yiibai_db=# REVOKE ALL ON COMPANY FROM manisha;REVOKE
 
REVOKE represents revoke all permissions from the user "manisha". Even delete a user, as shown below:
yiibai_db=# DROP USER manisha;DROP ROLE
 
DROP ROLE means to delete user "manisha" from the database.

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/11263016.html