4

通用机环境下安全版单机数据库使用非root用户管理的解决方案

 2 years ago
source link: https://blog.51cto.com/u_13646489/5503872
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

通用机环境下安全版单机数据库使用非root用户管理的解决方案

原创

瀚高实验室 2022-07-22 11:19:05 博主文章分类:Highgo DB ©著作权

文章标签 数据库 root用户 linux 文章分类 MySQL 数据库 阅读数216

瀚高数据库

系统平台:银河麒麟 (CPUX86_64),Linux x86-64 Red Hat Enterprise Linux 7

版本:4.5.7,4.5.6,4.5.2

本文旨在提供通用机环境下瀚高数据库安全版单机场景使用非root用户管理的解决方案。

当安全版数据库安装完毕后,默认会使用root用户启动和管理数据库,在通用机环境下瀚高数据库安全版单机场景也可以使用非root用户来管理数据库。下面介绍使用highgo用户来管理数据库的具体操作步骤。

注:需要先将数据库停库后再进行操作,操作完毕后正常启动数据库即可。

第一步,将软件目录的属主和属组改为对应系统用户。

chown highgo:highgo /opt/HighGo4.5.7-see -R

第二步,修改systemctl服务文件,将User=root改为User=highgo。

vi /usr/lib/systemd/system/hgdb-see-4.5.7.service

[Unit]

Description=highgodb-4.5.7

Requires=network.target local-fs.target

After=network.target local-fs.target

[Service]

Type=forking

User=highgo

............

第三步,当data目录不在默认的安装目录中时,修改data目录的属主和属组。

chown highgo:highgo $PGDATA -R

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK