Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
95ffe086
Commit
95ffe086
authored
Dec 05, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update database setup instructions to be more consistent
parent
d1e31bfc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
43 deletions
+31
-43
doc/install/databases.md
doc/install/databases.md
+29
-21
doc/install/installation.md
doc/install/installation.md
+2
-22
No files found.
doc/install/databases.md
View file @
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
## MySQL
# Install the database packages
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
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
# Login to MySQL
$ mysql -u root -p
$ 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
# Create the GitLab production database
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
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
# Grant the GitLab user necessary permissopns on the table.
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';
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
## PostgreSQL
# Install the database packages
sudo apt-get install -y postgresql-9.1 postgresql-server-dev-9.1
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
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';
template1=# CREATE USER gitlab WITH PASSWORD '$password';
# Create the GitLab production database & grant all privileges on database
# Create the GitLab production database & grant all privileges on database
template1=# CREATE DATABASE gitlabhq_production OWNER gitlab;
template1=# CREATE DATABASE gitlabhq_production OWNER gitlab;
# Quit
from PostgreSQL server
# Quit
the database session
template1=# \q
template1=# \q
# Try connect
to new database
# Try connect
ing to the new database with the new user
sudo -u gitlab psql -d gitlabhq_production
sudo -u gitlab
-H
psql -d gitlabhq_production
#
### Select the database you want to use
#
Configure GitLab
# Mysql
# Mysql
sudo -u gitlab cp config/database.yml.mysql config/database.yml
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.
...
@@ -49,12 +65,4 @@ GitLab use MySQL as default database but you are free to use PostgreSQL.
# PostgreSQL
# PostgreSQL
sudo -u gitlab cp config/database.yml.postgresql config/database.yml
sudo -u gitlab cp config/database.yml.postgresql config/database.yml
# make sure to update username/password in 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
doc/install/installation.md
View file @
95ffe086
...
@@ -122,21 +122,9 @@ Check the [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wik
...
@@ -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.
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
See doc/install/databases.md
# 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';
# 6. GitLab
# 6. GitLab
...
@@ -162,12 +150,6 @@ and ensure you have followed all of the above steps carefully.
...
@@ -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
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
# Copy unicorn config
#
#
sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb
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:
...
@@ -269,8 +251,6 @@ You can login via web using admin generated with setup:
# Advanced setup tips:
# Advanced setup tips:
_Checkout databases.md for PostgreSQL_
## Customizing Resque's Redis connection
## Customizing Resque's Redis connection
If you'd like Resque to connect to a Redis server on a non-standard port or on
If you'd like Resque to connect to a Redis server on a non-standard port or on
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment