Django学习记录(三)
2014-02-21 15:14
393 查看
postgresql 的配置
安装postgresql在前面已经有了,再安装和python的接口包psycopg2,也在前面写了
psql (PostgreSQL) 8.4.18
我操作如下
这样我们就创建一个数据库用户dbuser,他的数据库是mydb
如下为参考:
http://www.cnblogs.com/terrysun/archive/2012/11/30/2796479.html
http://jingyan.baidu.com/article/3ea51489ec3cb452e71bba52.html
http://stackoverflow.com/questions/2942485/psql-fatal-ident-authentication-failed-for-user-postgres
安装postgresql在前面已经有了,再安装和python的接口包psycopg2,也在前面写了
psql (PostgreSQL) 8.4.18
我操作如下
service postgresql initdb service postgresql start su - postgres psql postgres=#\password postgres #设置postgres的密码 createuser dbuser Shall the new role be a superuser? (y/n) y psql postgres=#\password dbuser createdb mydb -O dbuser exit vim /var/lib/pgsql/data/pg_hba.conf #修改一下 cat /var/lib/pgsql/data/pg_hba.conf local all all trust host all all 127.0.0.1/32 trust host all all ::1/128 trust psql -U dbuser -d mydb -h 127.0.0.1 -p 5432 /etc/init.d/postgresql reload psql -U dbuser -d mydb -h 127.0.0.1 -p 5432
这样我们就创建一个数据库用户dbuser,他的数据库是mydb
如下为参考:
http://www.cnblogs.com/terrysun/archive/2012/11/30/2796479.html
http://jingyan.baidu.com/article/3ea51489ec3cb452e71bba52.html
http://stackoverflow.com/questions/2942485/psql-fatal-ident-authentication-failed-for-user-postgres
相关文章推荐
- django使用celery学习记录
- Django学习记录一环境安装
- django学习记录,动态web页面尝试
- 学习django框架,记录所遇到的问题以及解决方法
- django学习记录,windows下访问
- Django学习记录-1
- django前后端数据传输学习记录
- django中日志使用学习记录
- web 框架 Django 学习记录 (二)把数据库中表内容展示在页面
- Django 学习,异常解决记录
- django学习记录--第一个网页“hello django”
- python 之django学习记录
- 记录自己的django学习
- django学习记录-RequestContext
- Django新手学习总结整理记录
- Django学习记录之Django 1.8 教程(我只是官网的搬运工)Tutorial Part 2
- django book学习问题记录
- Django 1.10 学习记录
- 学习django的心得与记录
- django学习记录-django-1.5中简单地自定义自己的用户模型