summaryrefslogtreecommitdiff
path: root/doc/install/databases.md
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-25 11:49:31 +0300
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-25 11:57:23 +0300
commitf9def67981f34c843124b71823c6b1f41cf529e6 (patch)
tree9fe924fc886f4324ebd0bdabed6d5ea45bd8b7bb /doc/install/databases.md
parentfd86bf4ae9ccfaab6cf4dfba38de6c7e0b80ec9f (diff)
downloadgitlab-ce-f9def67981f34c843124b71823c6b1f41cf529e6.tar.gz
move installation docs under separate dir
Diffstat (limited to 'doc/install/databases.md')
-rw-r--r--doc/install/databases.md75
1 files changed, 75 insertions, 0 deletions
diff --git a/doc/install/databases.md b/doc/install/databases.md
new file mode 100644
index 00000000000..8ca3d8fe51f
--- /dev/null
+++ b/doc/install/databases.md
@@ -0,0 +1,75 @@
+# Databases:
+
+GitLab use mysql as default database but you are free to use PostgreSQL or SQLite.
+
+
+## SQLite
+
+ sudo apt-get install -y sqlite3 libsqlite3-dev
+
+## MySQL
+
+ 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';
+
+
+## PostgreSQL
+
+ sudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2
+
+ # Connect to database server
+ sudo -u postgres psql -d template1
+
+ # Add a user called gitlab. Change $password to a real password
+ template1=# CREATE USER gitlab WITH PASSWORD '$password';
+
+ # Create the GitLab production database
+ template1=# CREATE DATABASE IF NOT EXISTS gitlabhq_production;
+
+ # Grant all privileges on database
+ template1=# GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab;
+
+ # Quit from PostgreSQL server
+ template1=# \q
+
+ # Try connect to new database
+ $ su - gitlab
+ $ psql -d gitlabhq_production -U gitlab
+
+
+
+#### Select the database you want to use
+
+ # SQLite
+ sudo -u gitlab cp config/database.yml.sqlite config/database.yml
+
+ # Mysql
+ sudo -u gitlab cp config/database.yml.mysql config/database.yml
+
+ # PostgreSQL
+ sudo -u gitlab cp config/database.yml.postgres 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 sqlite postgres --deployment
+
+ # or postgres
+ sudo -u gitlab -H bundle install --without development test sqlite mysql --deployment
+
+ # or sqlite
+ sudo -u gitlab -H bundle install --without development test mysql postgres --deployment
+