Centos 安装 postgresql
文章目录
添加 Yum 源
访问 https://www.postgresql.org/download 选择操作 postgresql 版本及对应的操作系统,从生成安装脚本中选择 rpm 源。
执行安装命令
# Install the repository RPM:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install PostgreSQL:
sudo yum install postgresql13-server -y
# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
sudo systemctl enable postgresql-13
sudo systemctl start postgresql-13设置环境变量
vim ~/.bashrc
export PATH=$PATH:/usr/pgsql-13/bin登录
$ su postgres
$ psql修改 ROOT 用户密码
postgres-# alter user postgres with password '123456';
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论