安装
ubuntu18.04下的安装
添加仓库源并安装
1 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - # add key |
1 | echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list # add list |
1 | sudo apt update && sudo apt install postgresql-11 # 安装 |
设置密码
配置一下默认的postgres用户的密码,登陆数据库要用到。
1 | sudo -u postgres psql |
2 | \password |