Skip to content

Commit 32c4d77

Browse files
committed
Merge branch 'docs/fix-mysql-docs-links' into 'master'
Fix broken links and other minor improvements See merge request gitlab-org/gitlab-ce!22858
2 parents fdfcee1 + 65dda22 commit 32c4d77

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

doc/install/database_mysql.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
# Database MySQL
22

3-
> **Note:**
4-
> - We do not recommend using MySQL due to various issues. For example, case
5-
[(in)sensitivity](https://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html)
6-
and [problems](https://bugs.mysql.com/bug.php?id=65830) that
7-
[suggested](https://bugs.mysql.com/bug.php?id=50909)
8-
[fixes](https://bugs.mysql.com/bug.php?id=65830) [have](https://bugs.mysql.com/bug.php?id=63164).
3+
NOTE: **Note:**
4+
We do not recommend using MySQL due to various issues.
5+
For example, there have been bugs with case
6+
[(in)sensitivity](https://dev.mysql.com/doc/refman/5.7/en/case-sensitivity.html).
7+
8+
Bugs relating to case sensitivity:
9+
10+
- <https://bugs.mysql.com/bug.php?id=65830>
11+
- <https://bugs.mysql.com/bug.php?id=50909>
12+
- <https://bugs.mysql.com/bug.php?id=65830>
13+
- <https://bugs.mysql.com/bug.php?id=63164>
914

1015
## Initial database setup
1116

12-
```
17+
```sh
1318
# Install the database packages
1419
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
1520

@@ -84,8 +89,9 @@ GitLab 8.14 has introduced [a feature](https://gitlab.com/gitlab-org/gitlab-ce/m
8489
Follow the below instructions to ensure you use the most up to date requirements for your GitLab MySQL Database.
8590

8691
**We are about to do the following:**
92+
8793
- Ensure you can enable `utf8mb4` encoding and `utf8mb4_general_ci` collation for your GitLab DB, tables and data.
88-
- Convert your GitLab tables and data from `utf8`/`utf8_general_ci` to `utf8mb4`/`utf8mb4_general_ci`
94+
- Convert your GitLab tables and data from `utf8`/`utf8_general_ci` to `utf8mb4`/`utf8mb4_general_ci`.
8995

9096
### Check for utf8mb4 support
9197

@@ -130,28 +136,28 @@ We need to check, enable and maybe convert your existing GitLab DB tables to the
130136
131137
Whatever the results of your checks above, we now need to check if your GitLab database has been created using [InnoDB File-Per-Table Tablespaces](http://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) (i.e. `innodb_file_per_table` was set to **1** at initial setup time).
132138

133-
> Note: This setting is [enabled by default](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_file_per_table) since MySQL 5.6.6.
139+
NOTE: **Note:**
140+
This setting is [enabled by default](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_file_per_table) since MySQL 5.6.6.
134141

135142
# Run this command with root privileges, replace the data dir if different:
136143
sudo ls -lh /var/lib/mysql/gitlabhq_production/*.ibd | wc -l
137144

138145
# Run this command with root privileges, replace the data dir if different:
139146
sudo ls -lh /var/lib/mysql/gitlabhq_production/*.frm | wc -l
140147

141-
142148
- **Case 1: a result > 0 for both commands**
143149

144-
Congrats, your GitLab database uses the right InnoDB tablespace format.
150+
Congratulations, your GitLab database uses the right InnoDB tablespace format.
145151

146152
However, you must still ensure that any **future tables** created by GitLab will still use the right format:
147153

148154
- If `SELECT @@innodb_file_per_table` returned **1** previously, your server is running correctly.
149155

150-
> It's however a requirement to check *now* that this setting is indeed persisted in your [my.cnf](https://dev.mysql.com/doc/refman/5.7/en/tablespace-enabling.html) file!
156+
> It's however a requirement to check *now* that this setting is indeed persisted in your [`my.cnf`](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) file!
151157
152158
- If `SELECT @@innodb_file_per_table` returned **0** previously, your server is not running correctly.
153159

154-
> [Enable innodb_file_per_table](https://dev.mysql.com/doc/refman/5.7/en/tablespace-enabling.html) by running in a MySQL session as root the command `SET GLOBAL innodb_file_per_table=1, innodb_file_format=Barracuda;` and persist the two settings in your [my.cnf](https://dev.mysql.com/doc/refman/5.7/en/tablespace-enabling.html) file
160+
> [Enable innodb_file_per_table](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) by running in a MySQL session as root the command `SET GLOBAL innodb_file_per_table=1, innodb_file_format=Barracuda;` and persist the two settings in your [`my.cnf`](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) file.
155161
156162
Now, if you have a **different result** returned by the 2 commands above, it means you have a **mix of tables format** uses in your GitLab database. This can happen if your MySQL server had different values for `innodb_file_per_table` in its life and you updated GitLab at different moments with those inconsistent values. So keep reading.
157163

@@ -172,7 +178,7 @@ Let's enable what we need on the running server:
172178
# You can now quit the database session
173179
mysql> \q
174180

175-
> Now, **persist** [innodb_file_per_table](https://dev.mysql.com/doc/refman/5.6/en/tablespace-enabling.html) and [innodb_file_format](https://dev.mysql.com/doc/refman/5.6/en/innodb-file-format-enabling.html) in your `my.cnf` file.
181+
> Now, **persist** [innodb_file_per_table](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) and [innodb_file_format](https://dev.mysql.com/doc/refman/5.7/en/innodb-file-format-enabling.html) in your `my.cnf` file.
176182
177183
Ensure at this stage that your GitLab instance is indeed **stopped**.
178184

@@ -184,7 +190,7 @@ Now, let's convert all the GitLab database tables to the new tablespace format:
184190
# Type the MySQL root password
185191
mysql > use gitlabhq_production;
186192

187-
# Safety check: you should still have those values set as follow:
193+
# Safety check: you should still have those values set as follows:
188194
mysql> SELECT @@innodb_file_per_table, @@innodb_file_format;
189195
+-------------------------+----------------------+
190196
| @@innodb_file_per_table | @@innodb_file_format |
@@ -203,7 +209,7 @@ Now, let's convert all the GitLab database tables to the new tablespace format:
203209

204210
#### Check for proper InnoDB File Format, Row Format, Large Prefix and tables conversion
205211

206-
We need to check, enable and probably convert your existing GitLab DB tables to use the [Barracuda InnoDB file format](https://dev.mysql.com/doc/refman/5.6/en/innodb-file-format.html), the [DYNAMIC row format](https://dev.mysql.com/doc/refman/5.6/en/glossary.html#glos_dynamic_row_format) and [innodb_large_prefix](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix) as a second prerequisite for supporting **utfb8mb4 with long indexes** used by recent GitLab databases.
212+
We need to check, enable and probably convert your existing GitLab DB tables to use the [Barracuda InnoDB file format](https://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html), the [DYNAMIC row format](https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_dynamic_row_format) and [innodb_large_prefix](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix) as a second prerequisite for supporting **utfb8mb4 with long indexes** used by recent GitLab databases.
207213

208214
# Login to MySQL
209215
mysql -u root -p
@@ -229,7 +235,7 @@ We need to check, enable and probably convert your existing GitLab DB tables to
229235
| utf8 | utf8_general_ci |
230236
+--------------------------+----------------------+
231237

232-
> Now, ensure that [innodb_file_format](https://dev.mysql.com/doc/refman/5.6/en/tablespace-enabling.html) and [innodb_large_prefix](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix) are **persisted** in your `my.cnf` file.
238+
> Now, ensure that [innodb_file_format](https://dev.mysql.com/doc/refman/5.7/en/innodb-multiple-tablespaces.html) and [innodb_large_prefix](http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix) are **persisted** in your `my.cnf` file.
233239
234240
#### Tables and data conversion to utf8mb4
235241

@@ -257,7 +263,7 @@ Now that you have a persistent MySQL setup, you can safely upgrade tables after
257263

258264
Ensure your GitLab database configuration file uses a proper connection encoding and collation:
259265

260-
```sudo -u git -H editor config/database.yml```
266+
`sudo -u git -H editor config/database.yml`
261267

262268
production:
263269
adapter: mysql2
@@ -266,19 +272,19 @@ Ensure your GitLab database configuration file uses a proper connection encoding
266272

267273
[Restart your GitLab instance](../administration/restart_gitlab.md).
268274

269-
270275
## MySQL strings limits
271276

272277
After installation or upgrade, remember to run the `add_limits_mysql` Rake task:
273278

274279
**Omnibus GitLab installations**
275-
```
280+
281+
```sh
276282
sudo gitlab-rake add_limits_mysql
277283
```
278284

279285
**Installations from source**
280286

281-
```
287+
```sh
282288
bundle exec rake add_limits_mysql RAILS_ENV=production
283289
```
284290

0 commit comments

Comments
 (0)