一步步带你centos 安装postgresql

    科技2022-07-11  82

    # 上传下载的Postgresql的rpm到服务器,然后执行本地安装 yum localinstall -y *.rpm # 找打Postgresql的安装文件 postgresql-setup 什么的 locate setup |grep post # 进入到目录执行 postgresql-setup --initdb # 启动Postgresql systemctl start postgresql # 查看状态 systemctl status postgresql # 连接 su -l postgres # 激活终端 psql # 重置密码 \password # 参考自:https://www.jianshu.com/p/4da8b0405799 # 查看所有用户 \du CREATE USER chaojilaji WITH PASSWORD 'xxxxxx'; CREATE DATABASE spider_xxxxx OWNER chaojilaji; GRANT ALL PRIVILEGES ON DATABASE spider_xxxxxx TO chaojilaji; ALTER USER postgres with password 'xxxxxx'; # 连接 psql -p 5432 -U chaojilaji spider_xxxxxxx # linux上面安装pgAdmin
    Processed: 0.018, SQL: 8