forked from haiyun-document/gitlab-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate.sql
36 lines (29 loc) · 932 Bytes
/
create.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- ------------------------------------------------------------------
-- Create required data for GitLab
-- ------------------------------------------------------------------
SET sql_mode='ANSI_QUOTES';
-- Workaround: DROP USER IF EXISTS still not supported
GRANT USAGE ON *.* TO "gitlab"@"localhost";
DROP USER
"gitlab"@"localhost";
-- Drop the database if exists
DROP DATABASE IF EXISTS
"gitlabhq_production";
-- Create our user
CREATE USER
"gitlab"@"localhost"
IDENTIFIED BY 'gitlab,';
-- Create GitLab db
CREATE DATABASE IF NOT EXISTS
"gitlabhq_production"
DEFAULT CHARACTER SET 'utf8'
COLLATE 'utf8_unicode_ci';
-- Grant privileges
GRANT SELECT, LOCK TABLES,
INSERT, UPDATE, DELETE,
CREATE, DROP, INDEX, ALTER
ON "gitlabhq_production".*
TO "gitlab"@"localhost"
-- ------------------------------------------------------------------
-- EOF
-- ------------------------------------------------------------------