File: mysql_config_editor.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (342 lines) | stat: -rw-r--r-- 8,575 bytes parent folder | download
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#
# Testing mysql_config_editor utility.
#
################################################
# Tests for mysql_config_editor's insert command
################################################
#
# Default login path (client)
# done..
# 'test-login-path1'
# done..
# 'test-login-path2'
# done..
# 'test-login-path3'
# done..

################################################
# Tests for mysql_config_editor's print command
################################################
#
# Default path
[client]
user = "test_user1"
host = "localhost"

#
# test-login-path1
[test-login-path1]
user = "test_user2"
host = "127.0.0.1"

#
# test-login-path2
[test-login-path2]
user = "test_user3"
host = "www.mysql.com"

#
# all the paths
[client]
user = "test_user1"
host = "localhost"
[test-login-path1]
user = "test_user2"
host = "127.0.0.1"
[test-login-path2]
user = "test_user3"
host = "www.mysql.com"
[test-login-path3]
user = "test_user4"
host = "127.0.0.1"
socket = "/tmp/configtest.sock"
port = 15000

#
# Overwrite existing paths, test-login-path2 & default
#
# all the paths again
[test-login-path1]
user = "test_user2"
host = "127.0.0.1"
[test-login-path3]
user = "test_user4"
host = "127.0.0.1"
socket = "/tmp/configtest.sock"
port = 15000
[test-login-path2]
user = "test_user4"
[client]
user = "test_user5"

################################################
# Tests for mysql_config_editor's remove command
################################################
#
# Default path
# done..
# test-login-path1
# done..
# test-login-path3
# done..

########################
# Printing the leftovers
########################
#
# using all
[test-login-path3]
user = "test_user4"
host = "127.0.0.1"
[test-login-path2]
user = "test_user4"

###############################################
# Tests for mysql_config_editor's reset command
###############################################
# done..
# Print-all to check if everything got deleted.

##############################################
# Tests for mysql_config_editor's help command
##############################################
Copyright (c) 2012, 2025, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

MySQL Configuration Utility.
  -?, --help          Display this help and exit.
  -v, --verbose       Write more information.
  -V, --version       Output version information and exit.

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- ----------------------------------------
verbose                           FALSE

Where command can be any one of the following :
       set [command options]     Sets user name/password/host name/socket/port
                                 for a given login path (section).
       remove [command options]  Remove a login path from the login file.
       print [command options]   Print all the options for a specified
                                 login path.
       reset [command options]   Deletes the contents of the login file.
       help                      Display this usage/help information.

# done..

######################
# Testing client tools
######################
#
# Inserting login paths default & test-login-path1
File exists.
File has the required permission.
Opening the file.
Reading the login key.
Login key read successfully.
Executing set command.
Successfully decrypted the login file.
Key successfully written to the file.
Successfully written encrypted data to the login file.
File exists.
File has the required permission.
Opening the file.
Reading the login key.
Login key read successfully.
Executing set command.
Successfully decrypted the login file.
Key successfully written to the file.
Successfully written encrypted data to the login file.
File exists.
File has the required permission.
Opening the file.
Reading the login key.
Login key read successfully.
Executing set command.
Successfully decrypted the login file.
Key successfully written to the file.
Successfully written encrypted data to the login file.
# done..

# Connecting using 'test_user1'
#
ERROR 1045 (28000): Access denied for user 'test_user1'@'localhost' (using password: NO)

# Connecting using 'test_user2'
#
ERROR 1045 (28000): Access denied for user 'test_user2'@'localhost' (using password: NO)
# Creating user 'test_user1'
CREATE USER test_user1;
# Creating user 'test_user2'
CREATE USER test_user2;
FLUSH PRIVILEGES;
#
# Now trying to connect again..
# Connecting using 'test_user1'
#
mysqld is alive
mysqld is alive

# Connecting using 'test_user2'
#
mysqld is alive
mysqld is alive
#
# Inserting a login path to test group suffix (client_suffix1)

# Printing all the paths..
[client]
user = "test_user1"
host = "localhost"
[test-login-path1]
user = "test_user2"
host = "127.0.0.1"
[test-login-path2]
user = "test_user3"
host = "127.0.0.1"
socket = "/tmp/configtest.sock"
port = 15000
[client_suffix1]
user = "test_user3"

# Now trying to connect using 'test_user3'
# Note : In this case options from login
#        paths 'client' (default) and 
#        client_suffix1 will be read..
ERROR 1045 (28000): Access denied for user 'test_user3'@'localhost' (using password: NO)
## Running my_print_defaults ##
#
# (a) With --no-defaults option..
# It should print the options under the default
# login path 'client'.
--user=test_user1
--host=localhost

# (b) With --no-defaults & --login-path
--user=test_user1
--host=localhost
--user=test_user2
--host=127.0.0.1
--user=test_user1
--host=localhost
--user=test_user3
--host=127.0.0.1
--socket=/tmp/configtest.sock
--port=15000

# (c) With --no-defaults & --defaults-group-suffix
--user=test_user1
--host=localhost
--user=test_user3

# (d) With --no-defaults, --login-path & --defaults-group-suffix
--user=test_user1
--host=localhost
--user=test_user2
--host=127.0.0.1

# Dropping users 'test_user1' & 'test_user2'
DROP USER test_user1, test_user2;

###############################
# Resetting the test login file
###############################
# done..

####################################
# Testing with an invalid login file
####################################
# mysql_config_editor.test
This is non-standard test login file.
# The 'invalid' login file should not cause
# any problem.
#
mysqld is alive
###############################
# Dropping the test login file
###############################

#################################
# Testing with login file removed
#################################
# Even if login file does not exist, the
# tools should be able to continue
# normally.
mysqld is alive

######################
# WL#2284 Testing client tools with 32 user name
######################
#
# Inserting login paths default & test-login-path_user_26
File does not exist.
Creating login file.
Login file created.
Opening the file.
Generating a new key.
Key successfully written to the file.
Executing set command.
Key successfully written to the file.
Successfully written encrypted data to the login file.
File exists.
File has the required permission.
Opening the file.
Reading the login key.
Login key read successfully.
Executing set command.
Successfully decrypted the login file.
Key successfully written to the file.
Successfully written encrypted data to the login file.
# done..

# Creating users for login
CREATE USER user_name_len_25_01234567@localhost;
CREATE USER user_name_len_26_012345678@localhost;
# Connecting using 'user_name_len_25_01234567'
#
mysqld is alive
mysqld is alive

# Connecting using 'user_name_len_26_012345678'
#
mysqld is alive
mysqld is alive

# Dropping users 'user_name_len_25_01234567@localhost' & 'CREATE USER user_name_len_26_012345678@localhost'
DROP USER user_name_len_25_01234567@localhost,user_name_len_26_012345678@localhost;

###############################
# Resetting the test login file
###############################
# done..
#### End of test ####
#
# Bug #24557925: MYSQL_CONFIG_EDITOR CAN MAKE SERVER UNBOOTABLE
#
# Restarting the server. Should work
# restart
# Cleanup
#
# Bug#29861961: MYSQL_CONFIG_EDITOR CAN NOT DEAL PASSWORD WITH "#"
#
CREATE USER 'test#user1'@'localhost';
mysqld is alive
# Cleanup
DROP USER 'test#user1'@'localhost';
# End of 5.6 tests
#
# Bug #19953349: MYSQL_CONFIG_EDITOR DOES NOT ESCAPE STRINGS
#
CREATE USER 'test1 test1'@'localhost';
test: must contain space
[test11]
user = "test1 test1"
host = "127.0.0.1"
# test: must not fail with a space in the name
mysqld is alive
# cleanup
DROP USER 'test1 test1'@'localhost';
# End of 8.0 tests