Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
95ffe086
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
95ffe086
编写于
12月 05, 2012
作者:
R
Riyad Preukschas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update database setup instructions to be more consistent
上级
d1e31bfc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
43 deletion
+31
-43
doc/install/databases.md
doc/install/databases.md
+29
-21
doc/install/installation.md
doc/install/installation.md
+2
-22
未找到文件。
doc/install/databases.md
浏览文件 @
95ffe086
#
Databases:
#
Setup Database
GitLab use MySQL as default database but you are free to use PostgreSQL.
GitLab supports the following databases:
*
MySQL (preferred)
*
PostgreSQL
## MySQL
# Install the database packages
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
# Install only the necessary gems
sudo -u gitlab -H bundle install --deployment --without development test postgres
# Login to MySQL
$ mysql -u root -p
# Create a user for GitLab. (change $password to a real password)
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
# Create the GitLab production database
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
# Create the MySQL User change $password to a real password
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
# Grant proper permissions to the MySQL User
# Grant the GitLab user necessary permissopns on the table.
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
# Quit the database session
mysql> \q
# Try connecting to the new database with the new user
sudo -u gitlab -H mysql -u gitlab -p -D gitlabhq_production
## PostgreSQL
# Install the database packages
sudo apt-get install -y postgresql-9.1 postgresql-server-dev-9.1
# Connect to database server
# Install only the necessary gems
sudo -u gitlab -H bundle install --deployment --without development test mysql
# Login to PostgreSQL
sudo -u postgres psql -d template1
#
Add a user called gitlab. Change $password to a real password
#
Create a user for GitLab. (change $password to a real password)
template1=# CREATE USER gitlab WITH PASSWORD '$password';
# Create the GitLab production database & grant all privileges on database
template1=# CREATE DATABASE gitlabhq_production OWNER gitlab;
# Quit
from PostgreSQL server
# Quit
the database session
template1=# \q
# Try connect
to new database
sudo -u gitlab psql -d gitlabhq_production
# Try connect
ing to the new database with the new user
sudo -u gitlab
-H
psql -d gitlabhq_production
#
### Select the database you want to use
#
Configure GitLab
# Mysql
sudo -u gitlab cp config/database.yml.mysql config/database.yml
...
...
@@ -49,12 +65,4 @@ GitLab use MySQL as default database but you are free to use PostgreSQL.
# PostgreSQL
sudo -u gitlab cp config/database.yml.postgresql config/database.yml
# make sure to update username/password in config/database.yml
#### Install gems
# mysql
sudo -u gitlab -H bundle install --without development test postgres --deployment
# or postgres
sudo -u gitlab -H bundle install --without development test mysql --deployment
Make sure to update username/password in config/database.yml.
doc/install/installation.md
浏览文件 @
95ffe086
...
...
@@ -122,21 +122,9 @@ Check the [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wik
and ensure you have followed all of the above steps carefully.
# 5.
Mysql d
atabase
# 5.
D
atabase
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
# Login to MySQL
$ mysql -u root -p
# Create the GitLab production database
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
# Create the MySQL User change $password to a real password
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password';
# Grant proper permissions to the MySQL User
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
See doc/install/databases.md
# 6. GitLab
...
...
@@ -162,12 +150,6 @@ and ensure you have followed all of the above steps carefully.
#
sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml
# Copy mysql db config
#
# make sure to update username/password in config/database.yml
#
sudo -u gitlab cp config/database.yml.mysql config/database.yml
# Copy unicorn config
#
sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb
...
...
@@ -269,8 +251,6 @@ You can login via web using admin generated with setup:
# Advanced setup tips:
_Checkout databases.md for PostgreSQL_
## Customizing Resque's Redis connection
If you'd like Resque to connect to a Redis server on a non-standard port or on
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录