From 95ffe08674787b21172e38f9e1a4b47309c56418 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 5 Dec 2012 17:53:24 +0100 Subject: Update database setup instructions to be more consistent --- doc/install/databases.md | 50 ++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'doc/install/databases.md') diff --git a/doc/install/databases.md b/doc/install/databases.md index 1a6f739ecdc..1e714d793be 100644 --- a/doc/install/databases.md +++ b/doc/install/databases.md @@ -1,47 +1,63 @@ -# 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 connecting 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. -- cgit v1.2.1 From 78d3611eba515beb85b86c1fc238cbbdbb1bc02f Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Wed, 5 Dec 2012 18:18:09 +0100 Subject: Remove redundant packages and move database specific ones to the db setup * build-essential requires make, gcc * remove libmysql++-dev: the mysql2 gem only requires libmysqlclient-dev * remove postgresql-server-dev-9.1: the pg gem only requires libpq-dev * replace python-dev, python-pip with python2.7: the pygments.rb gem only requires python2.7 --- doc/install/databases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/install/databases.md') diff --git a/doc/install/databases.md b/doc/install/databases.md index 1e714d793be..92011647f11 100644 --- a/doc/install/databases.md +++ b/doc/install/databases.md @@ -35,7 +35,7 @@ GitLab supports the following databases: ## 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 libpq-dev # Install only the necessary gems sudo -u gitlab -H bundle install --deployment --without development test mysql -- cgit v1.2.1