Skip to content

Instantly share code, notes, and snippets.

@85636682
Last active August 29, 2015 14:06
Show Gist options
  • Save 85636682/36ca18bd584bb9d18eeb to your computer and use it in GitHub Desktop.
Save 85636682/36ca18bd584bb9d18eeb to your computer and use it in GitHub Desktop.
postgresql
新建源文件列表,把postgresql源单独添加在一个列表文件中
sudo vi /etc/apt/sources.list.d/pgdg.list
在文件中添加内容(只适用于Ubuntu 12,发行版本名称为precise)
deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
保存,退出。
导入apt key
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
执行安装
apt-get install postgresql libpq-dev
# 安装完成后参照RailsCast的#335 Deploying to a VPS配置
root@chunlea:~# sudo -u postgres psql
could not change directory to "/root"
psql (9.1.5)
Type "help" for help.
postgres=# \password # 修改psql用户的密码
postgres=# CREATE USER **** with password '******'; #不要忘了分号!
postgres-# CREATE DATABASE slyutest_production owner ****;
postgres=# \q
sudo /etc/init.d/postgresql start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment