postgresql 在ubuntu上安装步骤 (rails环境)
postgresql 在ubuntu下安装步骤 (rails环境)首先运行 sudo aptitude search postgres 查看本机有没有安装
postgresql 在ubuntu下安装步骤 (rails环境)
首先运行 sudo aptitude search postgres 查看本机有没有安装过ps的一些包。
如果列表内有显示有 C 包名 -XXX 用下面命令
sudo aptitude purge 全部卸载掉(我就是因为没有卸载,装了N遍)
然后用rm 删除没办法删除的目录
?
下面就是安装了
?
sudo aptitude install postgresql-server-dev-all libpq-dev postgresql
安装命令
sudo vi /etc/postgresql/8.4/main/pg_hba.conf
找到修改
local ? all ? ? ? ? all ? ? ? ? ? ? ? ? ? ? ? ? ?md5 local ? ?all ? ? postgres ? ? ? ?md5
sudo -u postgres psql template1进入模板数据库ALTER USER postgres with encrypted password 'shepherd'; 修改密码\q 退出sudo /etc/init.d/postgresql restart 重启服务psql -U postgres -W 使用管理员进如数据库,密码就是刚才更改的create user USERNAME with createdb encrypted password '123456'; 创建用户名。
To export a DB: pg_dump -U star67 -W -c star67_development > ps.out ? To import a DB: psql -U star67 -W star67_development < ps.out
导入导出数据