1
CALL mtr.add_suppression("Plugin test_plugin_server reported: 'Wrong password supplied for plug_dest'");
2
CALL mtr.add_suppression("The plugin 'new_plugin_server' used to authenticate user 'new_user'@'%' is not loaded. Nobody can currently login using this account.");
3
CREATE DATABASE test_user_db;
4
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
5
user plugin authentication_string
6
========== test 1.1.3.2 ====================================
7
CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
8
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
9
GRANT PROXY ON plug_dest TO plug_user;
10
Warning: Using a password on the command line interface can be insecure.
15
Tables_in_test_user_db
17
REVOKE PROXY ON plug_dest FROM plug_user;
18
Warning: Using a password on the command line interface can be insecure.
19
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
20
DROP USER plug_user,plug_dest;
21
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
22
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
23
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
24
GRANT PROXY ON plug_dest TO plug_user;
25
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
26
user plugin authentication_string
27
plug_dest mysql_native_password
28
plug_user test_plugin_server plug_dest
30
Warning: Using a password on the command line interface can be insecure.
35
Tables_in_test_user_db
37
REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user'
38
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
39
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''plug_dest'' at line 2
41
Warning: Using a password on the command line interface can be insecure.
46
Tables_in_test_user_db
48
REVOKE PROXY ON plug_dest FROM plug_user;
50
Warning: Using a password on the command line interface can be insecure.
51
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
52
DROP USER plug_user,plug_dest;
53
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
54
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
55
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
57
Warning: Using a password on the command line interface can be insecure.
58
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
59
GRANT PROXY ON plug_dest TO plug_user;
61
Warning: Using a password on the command line interface can be insecure.
66
Tables_in_test_user_db
68
REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user'
69
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
70
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''plug_dest'' at line 2
71
DROP USER plug_user,plug_dest;
72
========== test 1.2 ========================================
73
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
74
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
75
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
76
GRANT PROXY ON plug_dest TO plug_user;
77
Warning: Using a password on the command line interface can be insecure.
82
RENAME USER plug_dest TO new_dest;
83
Warning: Using a password on the command line interface can be insecure.
84
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
85
GRANT PROXY ON new_dest TO plug_user;
86
Warning: Using a password on the command line interface can be insecure.
87
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
88
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
89
user plugin authentication_string
90
new_dest mysql_native_password
91
plug_user test_plugin_server plug_dest
92
DROP USER plug_user,new_dest;
94
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
95
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
96
Warning: Using a password on the command line interface can be insecure.
97
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
98
GRANT PROXY ON plug_dest TO plug_user;
99
Warning: Using a password on the command line interface can be insecure.
104
RENAME USER plug_dest TO new_dest;
105
Warning: Using a password on the command line interface can be insecure.
106
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
107
GRANT PROXY ON new_dest TO plug_user;
108
Warning: Using a password on the command line interface can be insecure.
109
ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
110
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
111
user plugin authentication_string
112
new_dest mysql_native_password
113
plug_user test_plugin_server plug_dest
114
DROP USER plug_user,new_dest;
115
CREATE USER plug_user
116
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
117
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
118
GRANT PROXY ON plug_dest TO plug_user;
119
connect(plug_user,localhost,plug_user,plug_dest);
120
select USER(),CURRENT_USER();
121
USER() CURRENT_USER()
122
plug_user@localhost plug_dest@%
124
disconnect plug_user;
125
RENAME USER plug_user TO new_user;
126
connect(plug_user,localhost,new_user,plug_dest);
127
select USER(),CURRENT_USER();
128
USER() CURRENT_USER()
129
new_user@localhost plug_dest@%
131
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
132
user plugin authentication_string
133
new_user test_plugin_server plug_dest
134
plug_dest mysql_native_password
135
disconnect plug_user;
136
UPDATE mysql.user SET user='plug_user' WHERE user='new_user';
138
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
139
user plugin authentication_string
140
plug_dest mysql_native_password
141
plug_user test_plugin_server plug_dest
142
DROP USER plug_dest,plug_user;
143
========== test 1.3 ========================================
144
CREATE USER plug_user
145
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
146
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
147
GRANT PROXY ON plug_dest TO plug_user;
148
connect(plug_user,localhost,plug_user,plug_dest);
149
select USER(),CURRENT_USER();
150
USER() CURRENT_USER()
151
plug_user@localhost plug_dest@%
153
disconnect plug_user;
154
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
155
user plugin authentication_string
156
plug_dest mysql_native_password
157
plug_user test_plugin_server plug_dest
158
UPDATE mysql.user SET user='new_user' WHERE user='plug_user';
160
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
161
user plugin authentication_string
162
new_user test_plugin_server plug_dest
163
plug_dest mysql_native_password
164
UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user';
166
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
167
user plugin authentication_string
168
new_user test_plugin_server new_dest
169
plug_dest mysql_native_password
170
UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user';
172
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
173
user plugin authentication_string
174
new_user new_plugin_server new_dest
175
plug_dest mysql_native_password
176
connect(plug_user,localhost,new_user,new_dest);
177
ERROR HY000: Plugin 'new_plugin_server' is not loaded
178
UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user';
179
UPDATE mysql.user SET USER='new_dest' WHERE user='plug_dest';
181
GRANT PROXY ON new_dest TO new_user;
182
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
183
user plugin authentication_string
184
new_dest mysql_native_password
185
new_user test_plugin_server new_dest
186
connect(plug_user,localhost,new_user,new_dest);
187
select USER(),CURRENT_USER();
188
USER() CURRENT_USER()
189
new_user@localhost new_dest@%
191
disconnect plug_user;
192
UPDATE mysql.user SET USER='plug_dest' WHERE user='new_dest';
194
CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd';
195
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
196
user plugin authentication_string
197
new_dest mysql_native_password
198
new_user test_plugin_server new_dest
199
plug_dest mysql_native_password
200
GRANT ALL PRIVILEGES ON test.* TO new_user;
201
connect(plug_user,localhost,new_dest,new_dest_passwd);
202
select USER(),CURRENT_USER();
203
USER() CURRENT_USER()
204
new_dest@localhost new_dest@%
206
disconnect plug_user;
207
DROP USER new_user,new_dest,plug_dest;
208
========== test 2, 2.1, 2.2 ================================
209
CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
210
CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
211
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
212
user plugin authentication_string
213
test_plugin_server proxied_user
214
proxied_user mysql_native_password
215
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
216
SELECT USER(),CURRENT_USER();
217
USER() CURRENT_USER()
218
proxied_user@localhost proxied_user@%
219
========== test 2.2.1 ======================================
224
disconnect proxy_con;
225
connect(proxy_con,localhost,proxy_user,proxied_user);
226
ERROR 28000: Access denied for user 'proxy_user'@'localhost' (using password: YES)
227
GRANT PROXY ON proxied_user TO ''@'';
228
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
229
SELECT USER(),CURRENT_USER();
230
USER() CURRENT_USER()
231
proxied_user@localhost proxied_user@%
233
disconnect proxy_con;
234
connect(proxy_con,localhost,proxy_user,proxied_user);
235
SELECT USER(),CURRENT_USER();
236
USER() CURRENT_USER()
237
proxy_user@localhost proxied_user@%
238
========== test 2.2.1 ======================================
243
disconnect proxy_con;
244
DROP USER ''@'',proxied_user;
245
GRANT ALL PRIVILEGES ON test_user_db.* TO ''@''
246
IDENTIFIED WITH test_plugin_server AS 'proxied_user';
247
CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
248
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
249
user plugin authentication_string
250
test_plugin_server proxied_user
251
proxied_user mysql_native_password
252
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
253
SELECT USER(),CURRENT_USER();
254
USER() CURRENT_USER()
255
proxied_user@localhost proxied_user@%
260
disconnect proxy_con;
261
connect(proxy_con,localhost,proxy_user,proxied_user);
262
ERROR 28000: Access denied for user 'proxy_user'@'localhost' (using password: YES)
263
GRANT PROXY ON proxied_user TO ''@'';
264
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
265
SELECT USER(),CURRENT_USER();
266
USER() CURRENT_USER()
267
proxied_user@localhost proxied_user@%
269
disconnect proxy_con;
270
connect(proxy_con,localhost,proxy_user,proxied_user);
271
SELECT USER(),CURRENT_USER();
272
USER() CURRENT_USER()
273
proxy_user@localhost proxied_user@%
278
disconnect proxy_con;
279
DROP USER ''@'',proxied_user;
280
CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
281
CREATE USER proxied_user_1 IDENTIFIED BY 'proxied_user_1_pwd';
282
CREATE USER proxied_user_2 IDENTIFIED BY 'proxied_user_2_pwd';
283
CREATE USER proxied_user_3 IDENTIFIED BY 'proxied_user_3_pwd';
284
CREATE USER proxied_user_4 IDENTIFIED BY 'proxied_user_4_pwd';
285
CREATE USER proxied_user_5 IDENTIFIED BY 'proxied_user_5_pwd';
286
GRANT PROXY ON proxied_user_1 TO ''@'';
287
GRANT PROXY ON proxied_user_2 TO ''@'';
288
GRANT PROXY ON proxied_user_3 TO ''@'';
289
GRANT PROXY ON proxied_user_4 TO ''@'';
290
GRANT PROXY ON proxied_user_5 TO ''@'';
291
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
292
user plugin authentication_string
293
test_plugin_server proxied_user
294
proxied_user_1 mysql_native_password
295
proxied_user_2 mysql_native_password
296
proxied_user_3 mysql_native_password
297
proxied_user_4 mysql_native_password
298
proxied_user_5 mysql_native_password
299
connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
300
connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
301
connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
302
connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
303
connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
304
connection proxy_con_1;
305
SELECT USER(),CURRENT_USER();
306
USER() CURRENT_USER()
307
proxied_user_1@localhost proxied_user_1@%
311
connection proxy_con_2;
312
SELECT USER(),CURRENT_USER();
313
USER() CURRENT_USER()
314
proxied_user_2@localhost proxied_user_2@%
318
connection proxy_con_3;
319
SELECT USER(),CURRENT_USER();
320
USER() CURRENT_USER()
321
proxied_user_3@localhost proxied_user_3@%
325
connection proxy_con_4;
326
SELECT USER(),CURRENT_USER();
327
USER() CURRENT_USER()
328
proxied_user_4@localhost proxied_user_4@%
332
connection proxy_con_5;
333
SELECT USER(),CURRENT_USER();
334
USER() CURRENT_USER()
335
proxied_user_5@localhost proxied_user_5@%
340
disconnect proxy_con_1;
341
disconnect proxy_con_2;
342
disconnect proxy_con_3;
343
disconnect proxy_con_4;
344
disconnect proxy_con_5;
345
DROP USER ''@'',proxied_user_1,proxied_user_2,proxied_user_3,proxied_user_4,proxied_user_5;
346
========== test 3 ==========================================
347
GRANT ALL PRIVILEGES ON *.* TO plug_user
348
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
349
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
350
GRANT PROXY ON plug_dest TO plug_user;
352
DROP USER plug_user, plug_dest;
353
DROP DATABASE test_user_db;