Commit acdb808abc819180529855fa2f919587fa0dec58
1 parent
c1dddf8c
Exists in
spb-stable
and in
3 other branches
Update database documentation.
Showing
3 changed files
with
48 additions
and
47 deletions
Show diff stats
@@ -0,0 +1,45 @@ | @@ -0,0 +1,45 @@ | ||
1 | +## Note | ||
2 | + | ||
3 | +We do not recommend using MySQL due to various issues. For example, case [(in)sensitivity](https://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html) and [problems](http://bugs.mysql.com/bug.php?id=65830) that [suggested](http://bugs.mysql.com/bug.php?id=50909) [fixes](http://bugs.mysql.com/bug.php?id=65830) [have](http://bugs.mysql.com/bug.php?id=63164) . | ||
4 | + | ||
5 | +## MySQL | ||
6 | + | ||
7 | + # Install the database packages | ||
8 | + sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev | ||
9 | + | ||
10 | + # Pick a database root password (can be anything), type it and press enter | ||
11 | + # Retype the database root password and press enter | ||
12 | + | ||
13 | + # Secure your installation. | ||
14 | + sudo mysql_secure_installation | ||
15 | + | ||
16 | + # Login to MySQL | ||
17 | + mysql -u root -p | ||
18 | + | ||
19 | + # Type the database root password | ||
20 | + | ||
21 | + # Create a user for GitLab | ||
22 | + # do not type the 'mysql>', this is part of the prompt | ||
23 | + # change $password in the command below to a real password you pick | ||
24 | + mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password'; | ||
25 | + | ||
26 | + # Create the GitLab production database | ||
27 | + mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; | ||
28 | + | ||
29 | + # Grant the GitLab user necessary permissions on the table. | ||
30 | + mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'git'@'localhost'; | ||
31 | + | ||
32 | + # Quit the database session | ||
33 | + mysql> \q | ||
34 | + | ||
35 | + # Try connecting to the new database with the new user | ||
36 | + sudo -u git -H mysql -u git -p -D gitlabhq_production | ||
37 | + | ||
38 | + # Type the password you replaced $password with earlier | ||
39 | + | ||
40 | + # You should now see a 'mysql>' prompt | ||
41 | + | ||
42 | + # Quit the database session | ||
43 | + mysql> \q | ||
44 | + | ||
45 | + # You are done installing the database and can go back to the rest of the installation. |
doc/install/databases.md
@@ -2,52 +2,8 @@ | @@ -2,52 +2,8 @@ | ||
2 | 2 | ||
3 | GitLab supports the following databases: | 3 | GitLab supports the following databases: |
4 | 4 | ||
5 | -* MySQL (preferred) | ||
6 | -* PostgreSQL | ||
7 | - | ||
8 | - | ||
9 | -## MySQL | ||
10 | - | ||
11 | - # Install the database packages | ||
12 | - sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev | ||
13 | - | ||
14 | - # Pick a database root password (can be anything), type it and press enter | ||
15 | - # Retype the database root password and press enter | ||
16 | - | ||
17 | - # Secure your installation. | ||
18 | - sudo mysql_secure_installation | ||
19 | - | ||
20 | - # Login to MySQL | ||
21 | - mysql -u root -p | ||
22 | - | ||
23 | - # Type the database root password | ||
24 | - | ||
25 | - # Create a user for GitLab | ||
26 | - # do not type the 'mysql>', this is part of the prompt | ||
27 | - # change $password in the command below to a real password you pick | ||
28 | - mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password'; | ||
29 | - | ||
30 | - # Create the GitLab production database | ||
31 | - mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; | ||
32 | - | ||
33 | - # Grant the GitLab user necessary permissions on the table. | ||
34 | - mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'git'@'localhost'; | ||
35 | - | ||
36 | - # Quit the database session | ||
37 | - mysql> \q | ||
38 | - | ||
39 | - # Try connecting to the new database with the new user | ||
40 | - sudo -u git -H mysql -u git -p -D gitlabhq_production | ||
41 | - | ||
42 | - # Type the password you replaced $password with earlier | ||
43 | - | ||
44 | - # You should now see a 'mysql>' prompt | ||
45 | - | ||
46 | - # Quit the database session | ||
47 | - mysql> \q | ||
48 | - | ||
49 | - # You are done installing the database and can go back to the rest of the installation. | ||
50 | - | 5 | +* PostgreSQL (preferred) |
6 | +* [MySQL](doc/install/database_mysql.md) | ||
51 | 7 | ||
52 | ## PostgreSQL | 8 | ## PostgreSQL |
53 | 9 |
doc/install/installation.md
@@ -144,7 +144,7 @@ GitLab Shell is an ssh access and repository management software developed speci | @@ -144,7 +144,7 @@ GitLab Shell is an ssh access and repository management software developed speci | ||
144 | 144 | ||
145 | # 5. Database | 145 | # 5. Database |
146 | 146 | ||
147 | -To setup the MySQL/PostgreSQL database and dependencies please see [doc/install/databases.md](./databases.md). | 147 | +To setup the PostgreSQL/MySQL database and dependencies please see [doc/install/databases.md](doc/install/databases.md). |
148 | 148 | ||
149 | 149 | ||
150 | # 6. GitLab | 150 | # 6. GitLab |