You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -84,8 +89,9 @@ GitLab 8.14 has introduced [a feature](https://gitlab.com/gitlab-org/gitlab-ce/m
84
89
Follow the below instructions to ensure you use the most up to date requirements for your GitLab MySQL Database.
85
90
86
91
**We are about to do the following:**
92
+
87
93
- 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`.
89
95
90
96
### Check for utf8mb4 support
91
97
@@ -130,28 +136,28 @@ We need to check, enable and maybe convert your existing GitLab DB tables to the
130
136
131
137
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).
132
138
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.
134
141
135
142
# Run this command with root privileges, replace the data dir if different:
136
143
sudo ls -lh /var/lib/mysql/gitlabhq_production/*.ibd | wc -l
137
144
138
145
# Run this command with root privileges, replace the data dir if different:
139
146
sudo ls -lh /var/lib/mysql/gitlabhq_production/*.frm | wc -l
140
147
141
-
142
148
-**Case 1: a result > 0 for both commands**
143
149
144
-
Congrats, your GitLab database uses the right InnoDB tablespace format.
150
+
Congratulations, your GitLab database uses the right InnoDB tablespace format.
145
151
146
152
However, you must still ensure that any **future tables** created by GitLab will still use the right format:
147
153
148
154
- If `SELECT @@innodb_file_per_table` returned **1** previously, your server is running correctly.
149
155
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!
151
157
152
158
- If `SELECT @@innodb_file_per_table` returned **0** previously, your server is not running correctly.
153
159
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.
155
161
156
162
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.
157
163
@@ -172,7 +178,7 @@ Let's enable what we need on the running server:
172
178
# You can now quit the database session
173
179
mysql> \q
174
180
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.
176
182
177
183
Ensure at this stage that your GitLab instance is indeed **stopped**.
178
184
@@ -184,7 +190,7 @@ Now, let's convert all the GitLab database tables to the new tablespace format:
184
190
# Type the MySQL root password
185
191
mysql > use gitlabhq_production;
186
192
187
-
# Safety check: you should still have those values set as follow:
193
+
# Safety check: you should still have those values set as follows:
@@ -203,7 +209,7 @@ Now, let's convert all the GitLab database tables to the new tablespace format:
203
209
204
210
#### Check for proper InnoDB File Format, Row Format, Large Prefix and tables conversion
205
211
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.
207
213
208
214
# Login to MySQL
209
215
mysql -u root -p
@@ -229,7 +235,7 @@ We need to check, enable and probably convert your existing GitLab DB tables to
> 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.
233
239
234
240
#### Tables and data conversion to utf8mb4
235
241
@@ -257,7 +263,7 @@ Now that you have a persistent MySQL setup, you can safely upgrade tables after
257
263
258
264
Ensure your GitLab database configuration file uses a proper connection encoding and collation:
259
265
260
-
```sudo -u git -H editor config/database.yml```
266
+
`sudo -u git -H editor config/database.yml`
261
267
262
268
production:
263
269
adapter: mysql2
@@ -266,19 +272,19 @@ Ensure your GitLab database configuration file uses a proper connection encoding
266
272
267
273
[Restart your GitLab instance](../administration/restart_gitlab.md).
268
274
269
-
270
275
## MySQL strings limits
271
276
272
277
After installation or upgrade, remember to run the `add_limits_mysql` Rake task:
0 commit comments