Skip to content

Commit 3f784a9

Browse files
committed
Make database info same as official guide
1 parent e76bd4a commit 3f784a9

File tree

1 file changed

+38
-20
lines changed

1 file changed

+38
-20
lines changed

install/centos/README.md

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -311,32 +311,48 @@ Install `mysql` and enable the `mysqld` service to start on boot:
311311
chkconfig mysqld on
312312
service mysqld start
313313

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:
315315

316-
/usr/bin/mysql_secure_installation
316+
mysql --version
317317

318-
Create a new user and database for GitLab:
318+
Secure your installation:
319+
320+
mysql_secure_installation
321+
322+
Login to MySQL:
319323

320-
# Login to MySQL
321324
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';
325325

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+
327339
CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
328340

329-
# Grant the GitLab user necessary permissions on the table.
341+
Grant the GitLab user necessary permissions on the table:
342+
330343
GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'git'@'localhost';
331344

332-
# Quit the database session
345+
Quit the database session:
346+
333347
\q
334348

335349
Try connecting to the new database with the new user:
336350

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+
340356
\q
341357

342358
### 5.2 PostgreSQL
@@ -372,7 +388,7 @@ Configure the database user and password:
372388

373389
psql (8.4.20)
374390
Type "help" for help.
375-
template1=# CREATE USER git WITH PASSWORD 'your-password-here';
391+
template1=# CREATE USER git CREATEDB;
376392
CREATE ROLE
377393
template1=# CREATE DATABASE gitlabhq_production OWNER git;
378394
CREATE DATABASE
@@ -383,21 +399,23 @@ Test the connection as the gitlab (uid=git) user. You should be root to begin th
383399

384400
whoami
385401

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:
387403

388-
sudo -u git psql -d gitlabhq_production -U git -W
404+
sudo -u git psql -d gitlabhq_production
389405

390406
If you see the following:
391407

392408
gitlabhq_production=>
393409

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.
395411

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):
398414

399-
vi /var/lib/pgsql/9.3/data/pg_hba.conf
415+
host all all 127.0.0.1/32 trust
400416

417+
Check the official [documentation][psql-doc-auth] for more information on
418+
authentication methods.
401419

402420
----------
403421
## 6. GitLab

0 commit comments

Comments
 (0)