@@ -311,32 +311,48 @@ Install `mysql` and enable the `mysqld` service to start on boot:
311
311
chkconfig mysqld on
312
312
service mysqld start
313
313
314
- Secure MySQL by entering a root password and say "Yes" to all questions :
314
+ Ensure you have MySQL version 5.5.14 or later :
315
315
316
- /usr/bin/mysql_secure_installation
316
+ mysql --version
317
317
318
- Create a new user and database for GitLab:
318
+ Secure your installation:
319
+
320
+ mysql_secure_installation
321
+
322
+ Login to MySQL:
319
323
320
- # Login to MySQL
321
324
mysql -u root -p
322
- # Type the database root password
323
- # Create a user for GitLab. (change supersecret to a real password)
324
- CREATE USER 'git'@'localhost' IDENTIFIED BY 'supersecret';
325
325
326
- # Create the GitLab production database
326
+ Type the database root password.
327
+
328
+ Create a user for GitLab (change $password in the command below to a real password you pick):
329
+
330
+ mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password';
331
+
332
+ Ensure you can use the InnoDB engine which is necessary to support long indexes.
333
+ If this fails, check your MySQL config files (e.g. ` /etc/mysql/*.cnf ` , ` /etc/mysql/conf.d/* ` ) for the setting "innodb = off".
334
+
335
+ SET storage_engine=INNODB;
336
+
337
+ Create the GitLab production database"
338
+
327
339
CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
328
340
329
- # Grant the GitLab user necessary permissions on the table.
341
+ Grant the GitLab user necessary permissions on the table:
342
+
330
343
GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'git'@'localhost';
331
344
332
- # Quit the database session
345
+ Quit the database session:
346
+
333
347
\q
334
348
335
349
Try connecting to the new database with the new user:
336
350
337
- mysql -u git -p -D gitlabhq_production
338
- # Type the password you replaced supersecret with earlier
339
- # Quit the database session
351
+ sudo -u git -H mysql -u git -p -D gitlabhq_production
352
+
353
+ Type the password you replaced $password with earlier.
354
+ Quit the database session:
355
+
340
356
\q
341
357
342
358
### 5.2 PostgreSQL
@@ -372,7 +388,7 @@ Configure the database user and password:
372
388
373
389
psql (8.4.20)
374
390
Type "help" for help.
375
- template1=# CREATE USER git WITH PASSWORD 'your-password-here' ;
391
+ template1=# CREATE USER git CREATEDB ;
376
392
CREATE ROLE
377
393
template1=# CREATE DATABASE gitlabhq_production OWNER git;
378
394
CREATE DATABASE
@@ -383,21 +399,23 @@ Test the connection as the gitlab (uid=git) user. You should be root to begin th
383
399
384
400
whoami
385
401
386
- Attempt to log in to Postgres as the git user (enter the password you set up above) :
402
+ Attempt to log in to Postgres as the git user:
387
403
388
- sudo -u git psql -d gitlabhq_production -U git -W
404
+ sudo -u git psql -d gitlabhq_production
389
405
390
406
If you see the following:
391
407
392
408
gitlabhq_production=>
393
409
394
- Your password has been accepted successfully and you can type \q to quit.
410
+ your password has been accepted successfully and you can type \q to quit.
395
411
396
- You should ensure you are using the right settings in your pg_hba.conf to not get ident issues
397
- NOTE: set to something like "host all all 127.0.0.1/32 trust" use trust over ident
412
+ Ensure you are using the right settings in your ` /var/lib/pgsql/9.3/data/ pg_hba.conf`
413
+ to not get ident issues (you can use trust over ident):
398
414
399
- vi /var/lib/pgsql/9.3/data/pg_hba.conf
415
+ host all all 127.0.0.1/32 trust
400
416
417
+ Check the official [ documentation] [ psql-doc-auth ] for more information on
418
+ authentication methods.
401
419
402
420
----------
403
421
## 6. GitLab
0 commit comments