gitlab 使用postgresql数据库的一些说明
来源:互联网 发布:编程语言排行榜2017 8 编辑:程序博客网 时间:2024/06/07 07:06
# cd /var/opt/gitlab/postgresql/data
# vim pg_hba.conf
host all all 192.168.1.0/24 trust 添加这行,192.168.1.0/24这个段的ip地址不需要密码可以连接
# vim postgresql.conf
listen_addresses = '192.168.1.125' 修改监听地址为ip
# gitlab-ctl restart postgresql
# cd /opt/gitlab/embedded/
# # bin/psql -U gitlab -d gitlabhq_production -h 192.168.1.125 不用输入密码就可进来
psql (9.2.10)
Type "help" for help.
gitlabhq_production=> alter user gitlab with password 'gitlab' 修改gitlab密码,gitlab创建的数据库超级用户为gitlab-psql,想修改密码自己通过命令修改即可
gitlabhq_production-> \q 退出
# cd /var/opt/gitlab/postgresql/data
host all all 192.168.1.0/24 md5 修改trust 为md5 ,即连接需要密码
# gitlab-ctl restart postgresql
# /opt/gitlab/embedded/bin/psql -U gitlab -d gitlabhq_production -h 192.168.1.125
Password for user gitlab: 输入密码gitlab 回车就可以进来了
既然修改了数据库gitlab用户的密码,gitlab服务器中数据库配置文件,也需要修改,不然数据库连接不上
# cd /var/opt/gitlab/
# vim gitlab-rails/etc/database.yml
production:
adapter: postgresql
encoding: unicode
database: gitlabhq_production
pool: 10
username: 'gitlab'
password: 'gitlab' 添加设置的密码
host: 192.168.1.125 更改为ip地址
port: 5432
# gitlab-ctl restart
ok了,可以去访问看看是否正常
做了上面的配置,我们可以使用Navicat Premium 连接postgresql,因为对postgresql不是很熟,图形管理方便点。
- gitlab 使用postgresql数据库的一些说明
- postgresql数据库的游标使用例子说明
- postgresql的一些使用技巧
- postgresql的一些使用技巧
- postgresql使用的一些笔记
- Postgresql数据库的一些字符串操作函数
- Postgresql数据库的一些字符串操作函数
- Postgresql数据库的一些字符串操作函数
- Postgresql数据库的一些字符串操作函数
- Postgresql数据库的一些字符串操作函数
- Postgresql数据库的一些字符串操作函数
- PostgreSQL数据库一些特征
- gitlab和sourcetree的使用的一些问题
- PostgreSQL 9.5.2 数据库说明
- 使用postgresql来作为rails的数据库
- postgresql 数据库使用遇到的问题
- PostgreSQL数据库psql的使用之一
- PostgreSQL数据库psql的使用之二
- [LeetCode 173] Binary Search Tree Iterator
- Spring 3 JavaConfig @Import example
- springmvc学习笔记(一)第一个helloworld
- MapReduce实现join操作
- JSFF2 mount fail
- gitlab 使用postgresql数据库的一些说明
- TS流判断I帧
- poj 1129 Channel Allocation(DFS减枝)
- 基于Spring可扩展Schema提供自定义配置支持(spring配置文件中 配置标签支持)
- linux文件压缩命令
- 第一份软件测试实习(1)
- andriod安卓新闻类app页面数据图片缓存
- 黑马程序员-[C语言]学习日记(一)
- osgi7——camel发送rabbitmq