This repository has been archived by the owner on Jan 31, 2019. It is now read-only.
/
mysql-service.properties
175 lines (147 loc) · 5.77 KB
/
mysql-service.properties
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
jdbcPort=3306
win64 {
mysqlHome="mysql-5.5.24-winx64"
mysqlD="mysqld.exe"
mysqlProgram="mysql.exe"
mysqladmin="mysqladmin.exe"
mysqldump="mysqldump.exe"
zipName="${mysqlHome}.zip"
/* http://downloads.skysql.com/archive/index/p/mysql/v/5.5.24 */
zipURL="http://downloads.skysql.com/archives/mysql-5.5/${zipName}"
}
linux {
mysqlD="mysqld"
mysqlProgram="mysql"
mysqladmin="mysqladmin"
mysqldump="mysqldump"
}
dbName="tamirDB"
dbUser="tamir"
dbPassW="1234"
/* Use the following format - leave an empty string (startDetectionQuery="") for using the default startDetection ( by port ) :
startDetectionQuery="select count(XXX) as cc from table_name"
*/
startDetectionQuery=""
/*
actionType can be one of the four following: mysqladmin,mysql,mysqldump or import
Examples :
// In this case, dbName is a property which is defined in this properties file
// All the occurrences of MYSQLHOST in actionQuery, will be replaced with the private IP address on which this service instance resides
[
"actionType" : "mysqladmin",
"actionQuery" : "create" ,
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db - Name : ${dbName} ... "
] ,
// In this case, dbUser and dbPassW are properties which are defined in this properties file
// All the occurrences of MYSQLHOST in actionQuery, will be replaced with the private IP address on which this service instance resides
[
"actionType" : "mysql",
"actionQuery" : "\"CREATE USER '${dbUser}'@'localhost' IDENTIFIED BY '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db user ${dbUser} at localhost, passw ${dbPassW} in ${dbName} db... "
],
// In this case:
// dbName,currDBZip,currImportSql are properties which are defined in this properties file
// currDBZip is the local name of the zip file ( after download )
// currImportSql is the name of the sql file which is stored in currDBZip.
// All the occurrences of REPLACE_WITH_DB_NAME in currImportSql, will be replaced with ${dbName}
[
"actionType" : "import",
"importedZip" : "${currDBZip}",
"importedFile" : "${currImportSql}",
"importedFileUrl" : "http://dropbox/1/222/mysql.zip",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Importing to ${dbName} ..."
]
// In this case:
// dbName is a property which is defined in this properties file.
// if actionDbName is an empty string, then --all-databases will be used
// actionArgs contain the flags that you want to use with this mysqldump command
// Do NOT database flags, because they will be set according to the actionDbName.
// So do NOT use the following : --all-databases,-A,--databases, -B
// Do NOT -u flag flags, because it will be set according to the actionUser
[
"actionType" : "mysqldump",
"actionArgs" : "--add-drop-database -c --lock-all-tables -F",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"dumpPrefix" : "myDumpFile_",
"debugMsg" : "Invoking mysqldump ..."
]
*/
postStartActions = [
[
"actionType" : "mysqladmin",
"actionQuery" : "create" ,
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db - Name : ${dbName} ... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"CREATE USER '${dbUser}'@'localhost' IDENTIFIED BY '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db user ${dbUser} at localhost, passw ${dbPassW} in ${dbName} db... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"CREATE USER '${dbUser}'@'MYSQLHOST' IDENTIFIED BY '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db user ${dbUser} at MYSQLHOST, passw ${dbPassW} in ${dbName} db... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"CREATE USER '${dbUser}'@'%' IDENTIFIED BY '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Creating db user ${dbUser} at all hosts, passw ${dbPassW} in ${dbName} db... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant usage on *.* to ${dbUser}@localhost identified by '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting usage to user ${dbUser} at localhost, passw ${dbPassW} in ${dbName} db..."
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant usage on *.* to ${dbUser}@MYSQLHOST identified by '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting usage to user ${dbUser} at MYSQLHOST, passw ${dbPassW} in ${dbName} db..."
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant usage on *.* to ${dbUser}@'%' identified by '${dbPassW}';\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting usage to user ${dbUser} at all hosts, passw ${dbPassW} in ${dbName} db..."
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant all privileges on *.* to ${dbUser}@'localhost' with grant option;\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting all privileges to user ${dbUser} in ${dbName} db at localhost... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant all privileges on *.* to ${dbUser}@'MYSQLHOST' with grant option;\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting all privileges to user ${dbUser} in ${dbName} db at MYSQLHOST... "
],
[
"actionType" : "mysql",
"actionQuery" : "\"grant all privileges on *.* to ${dbUser}@'%' with grant option;\"",
"actionUser" : "root",
"actionDbName" : "${dbName}",
"debugMsg" : "Granting all privileges to user ${dbUser} in ${dbName} db at all hosts ... "
]
]