[root@localhost opt]# rpm -ivh 1b73693f2c91fd7f38acbc7d3882cf6c.rpm Preparing... ################################# [100%] Updating / installing... 1:hgdb-enterprise-6.0.4-1.el7.cento################################# [100%] 无遗留数据文件 Created symlink from /etc/systemd/system/multi-user.target.wants/hgdb-enterprise-6.0.4.service to /usr/lib/systemd/system/hgdb-enterprise-6.0.4.service. Created symlink from /etc/systemd/system/graphical.target.wants/hgdb-enterprise-6.0.4.service to /usr/lib/systemd/system/hgdb-enterprise-6.0.4.service.
[root@localhost package]# initdb initdb: error: cannot be run as root Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.
[highgo@localhost opt]$ initdb could not change directory to"/opt": Permission denied The files belonging to this database system will be owned by user "highgo". This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been setto"UTF8". The default text search configuration will be setto"english".
Data page checksums are disabled. Data encryption is disabled.
Enter new superuser password: # 输入复杂的密码完成(密码需要是大写小写数字和符号的组合。。。。。如密码aaa123@) Enter it again:
fixing permissions on existing directory /opt/HighGo6.0.4-cluster/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... America/Los_Angeles creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok
initdb: warning: enabling "md5" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
listen_addresses = '*' # what IP address(es) to listen on; # 新增这行,修改能够访问该数据库的外部ip地址以及访问控制权限 #listen_addresses = 'localhost' # what IP address(es) to listen on; # comma-separated list of addresses;
编辑 /opt/HighGo6.0.4-cluster/data/pg_hba.conf 文件
1 2 3 4
# 在IPV4的 local connections 添加一行 \#IPv4 local connections: hostallall127.0.0.1/32trust hostallall0.0.0.0/0md5# 添加这行