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 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
|
=======================================================================
Checking the password plugin assignment with create user command
=======================================================================
set @default_plugin=@@global.default_authentication_plugin;
Warnings:
Warning 1287 '@@default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
**** Creating user with default_plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED BY 'abc';
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password';
SET PASSWORD for 'Tanjotuser3'@'localhost' = 'abc';
**** Validating the plugin names
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')=@default_plugin;
(select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')=@default_plugin
1
1 Expected
select (select plugin from mysql.user where User='Tanjotuser3' and Host='localhost')='sha256_password';
(select plugin from mysql.user where User='Tanjotuser3' and Host='localhost')='sha256_password'
1
1 Expected
Drop user 'Tanjotuser1'@'localhost';
Drop user 'Tanjotuser3'@'localhost';
=======================================================================
Checking the functionality and integrity of the DROP user command
=======================================================================
**** Creating user with default_plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED BY 'abc';
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password';
SET PASSWORD for 'Tanjotuser3'@'localhost' = 'abc';
Connecting a session each with the above 3 users
dropping the above 3 users with each having a open session
Drop user 'Tanjotuser1'@'localhost';
Drop user 'Tanjotuser3'@'localhost';
Now trying opening a new session for the above dropped user
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: YES)
ERROR 28000: Access denied for user 'Tanjotuser3'@'localhost' (using password: YES)
Accessing the open sessions for the above dropped user
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
=======================================================================
Checking the privellages post renaming the user
=======================================================================
**** Creating user with default_plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED BY 'abc';
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password';
SET PASSWORD for 'Tanjotuser3'@'localhost' = 'abc';
**** Validating the plugin names
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')=@default_plugin;
(select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')=@default_plugin
1
1 Expected
select (select plugin from mysql.user where User='Tanjotuser3' and Host='localhost')='sha256_password';
(select plugin from mysql.user where User='Tanjotuser3' and Host='localhost')='sha256_password'
1
1 Expected
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
**** Validating the integrity of the rename user command
RENAME USER 'Tanjotuser1'@'localhost' to 'user1'@'localhost';
RENAME USER 'Tanjotuser3'@'localhost' to 'user3'@'localhost';
**** Validating the plugin names
select (select plugin from mysql.user where User='user1' and Host='localhost')=@default_plugin;
(select plugin from mysql.user where User='user1' and Host='localhost')=@default_plugin
1
1 Expected
select (select plugin from mysql.user where User='user3' and Host='localhost')='sha256_password';
(select plugin from mysql.user where User='user3' and Host='localhost')='sha256_password'
1
1 Expected
**** Validating the user connections post renaming
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: YES)
ERROR 28000: Access denied for user 'Tanjotuser3'@'localhost' (using password: YES)
select user(), current_user();
user() current_user()
user1@localhost user1@localhost
select user(), current_user();
user() current_user()
user3@localhost user3@localhost
**** Disconnecting the open sessions and dropping the created users
Drop user 'user1'@'localhost';
Drop user 'user3'@'localhost';
=======================================================================
Checking the privillages with grant user command
=======================================================================
**** Creating user with default_plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED BY 'abc';
GRANT select on mysql.* to 'Tanjotuser1'@'localhost';
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password' BY '123';
GRANT select on mysql.* to 'Tanjotuser3'@'localhost';
SET PASSWORD for 'Tanjotuser3'@'localhost' = 'abc';
**** Validating the granted privilleges
select plugin from mysql.user where user='Tanjotuser1' and host='localhost';
plugin
default_plugin
default_plugin Expected
select plugin from mysql.user where user='Tanjotuser3' and host='localhost';
plugin
sha256_password
sha256_password Expected
**** Revoking select on mysql database
Revoke select on mysql.* from 'Tanjotuser1'@'localhost';
Revoke select on mysql.* from 'Tanjotuser3'@'localhost';
**** Validating the Revoked privilleges
select plugin from mysql.user where user='Tanjotuser1' and host='localhost';
ERROR 42000: SELECT command denied to user 'Tanjotuser1'@'localhost' for table 'user'
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select plugin from mysql.user where user='Tanjotuser3' and host='localhost';
ERROR 42000: SELECT command denied to user 'Tanjotuser3'@'localhost' for table 'user'
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
Grant usage on mysql.* to 'Tanjotuser1'@'localhost';
Grant usage on mysql.* to 'Tanjotuser3'@'localhost';
**** Validating the granted privilleges
select plugin from mysql.user where user='Tanjotuser1' and host='localhost';
ERROR 42000: SELECT command denied to user 'Tanjotuser1'@'localhost' for table 'user'
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select plugin from mysql.user where user='Tanjotuser3' and host='localhost';
ERROR 42000: SELECT command denied to user 'Tanjotuser3'@'localhost' for table 'user'
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
**** Validating the granted privilleges
Grant All on mysql.* to 'Tanjotuser1'@'localhost';
Grant All on mysql.* to 'Tanjotuser3'@'localhost';
select plugin from mysql.user where user='Tanjotuser1' and host='localhost';
plugin
default_plugin
default_plugin Expected
select plugin from mysql.user where user='Tanjotuser3' and host='localhost';
plugin
sha256_password
sha256_password Expected
**** Disconnecting the open sessions and dropping the created users
Drop user 'Tanjotuser1'@'localhost';
Drop user 'Tanjotuser3'@'localhost';
=============================================================================
Checking the password assignment using the update command on the user table
=============================================================================
**** Creating user with mysql_native_password plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
UPDATE mysql.user SET Authentication_string='*0D3CED9BEC10A777AEC23CCC353A8C08A633045E' WHERE User='Tanjotuser1' AND Host='localhost';
FLUSH PRIVILEGES;
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password';
UPDATE IGNORE mysql.user SET Authentication_string='*0D3CED9BEC10A777AEC23CCC353A8C08A633045E' WHERE User='Tanjotuser3' AND Host='localhost';
FLUSH PRIVILEGES;
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
set password='abcd';
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
**** Disconnecting the open sessions and dropping the created users
Drop user 'Tanjotuser1'@'localhost';
Drop user 'Tanjotuser3'@'localhost';
===================================================================================================
Starting the server with default auth as sha256_password and checking the above validations again.
===================================================================================================
# Restart server with default-authentication-plugin=sha256_password;
=======================================================================
Checking the password plugin assignment with create user command
=======================================================================
**** Creating user with mysql_native_password plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
SET PASSWORD for 'Tanjotuser1'@'localhost' = 'abc';
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password';
SET PASSWORD for 'Tanjotuser3'@'localhost' = 'abc';
**** Validating the plugin names
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='mysql_native_password';
(select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='mysql_native_password'
1
1 Expected
select (select plugin from mysql.user where User='Tanjotuser3' and Host='localhost')='sha256_password';
(select plugin from mysql.user where User='Tanjotuser3' and Host='localhost')='sha256_password'
1
1 Expected
Drop user 'Tanjotuser1'@'localhost';
Drop user 'Tanjotuser3'@'localhost';
=======================================================================
Checking the functionality and integrity of the DROP user command
=======================================================================
**** Creating user with default_plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED BY 'abc';
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password';
SET PASSWORD for 'Tanjotuser3'@'localhost' = 'abc';
Connecting a session each with the above 3 users
dropping the above 3 users with each having a open session
Drop user 'Tanjotuser1'@'localhost';
Drop user 'Tanjotuser3'@'localhost';
Now trying opening a new session for the above dropped user
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: YES)
ERROR 28000: Access denied for user 'Tanjotuser3'@'localhost' (using password: YES)
Accessing the open sessions for the above dropped user
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
=======================================================================
Checking the privellages post renaming the user
=======================================================================
**** Creating user with mysql_native_password plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
SET PASSWORD for 'Tanjotuser1'@'localhost' = 'abc';
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password';
SET PASSWORD for 'Tanjotuser3'@'localhost' = 'abc';
**** Validating the plugin names
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='mysql_native_password';
(select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='mysql_native_password'
1
1 Expected
select (select plugin from mysql.user where User='Tanjotuser3' and Host='localhost')='sha256_password';
(select plugin from mysql.user where User='Tanjotuser3' and Host='localhost')='sha256_password'
1
1 Expected
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
**** Validating the integrity of the rename user command
RENAME USER 'Tanjotuser1'@'localhost' to 'user1'@'localhost';
RENAME USER 'Tanjotuser3'@'localhost' to 'user3'@'localhost';
**** Validating the plugin names
select (select plugin from mysql.user where User='user1' and Host='localhost')='mysql_native_password';
(select plugin from mysql.user where User='user1' and Host='localhost')='mysql_native_password'
1
1 Expected
select (select plugin from mysql.user where User='user3' and Host='localhost')='sha256_password';
(select plugin from mysql.user where User='user3' and Host='localhost')='sha256_password'
1
1 Expected
**** Validating the user connections post renaming
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
ERROR 28000: Access denied for user 'Tanjotuser1'@'localhost' (using password: YES)
ERROR 28000: Access denied for user 'Tanjotuser3'@'localhost' (using password: YES)
select user(), current_user();
user() current_user()
user1@localhost user1@localhost
select user(), current_user();
user() current_user()
user3@localhost user3@localhost
**** Disconnecting the open sessions and dropping the created users
Drop user 'user1'@'localhost';
Drop user 'user3'@'localhost';
=======================================================================
Checking the privillages with grant user command
=======================================================================
**** Creating user with mysql_native_password plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '123';
GRANT select on mysql.* to 'Tanjotuser1'@'localhost';
SET PASSWORD for 'Tanjotuser1'@'localhost' = 'abc';
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password' BY '123';
GRANT select on mysql.* to 'Tanjotuser3'@'localhost';
SET PASSWORD for 'Tanjotuser3'@'localhost' = 'abc';
**** Validating the granted privilleges
select plugin from mysql.user where user='Tanjotuser1' and host='localhost';
plugin
mysql_native_password
mysql_native_password Expected
select plugin from mysql.user where user='Tanjotuser3' and host='localhost';
plugin
sha256_password
sha256_password Expected
**** Revoking select on mysql database
Revoke select on mysql.* from 'Tanjotuser1'@'localhost';
Revoke select on mysql.* from 'Tanjotuser3'@'localhost';
**** Validating the Revoked privilleges
select plugin from mysql.user where user='Tanjotuser1' and host='localhost';
ERROR 42000: SELECT command denied to user 'Tanjotuser1'@'localhost' for table 'user'
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select plugin from mysql.user where user='Tanjotuser3' and host='localhost';
ERROR 42000: SELECT command denied to user 'Tanjotuser3'@'localhost' for table 'user'
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
Grant usage on mysql.* to 'Tanjotuser1'@'localhost';
Grant usage on mysql.* to 'Tanjotuser3'@'localhost';
**** Validating the granted privilleges
select plugin from mysql.user where user='Tanjotuser1' and host='localhost';
ERROR 42000: SELECT command denied to user 'Tanjotuser1'@'localhost' for table 'user'
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
select plugin from mysql.user where user='Tanjotuser3' and host='localhost';
ERROR 42000: SELECT command denied to user 'Tanjotuser3'@'localhost' for table 'user'
select user(), current_user();
user() current_user()
Tanjotuser3@localhost Tanjotuser3@localhost
**** Validating the granted privilleges
Grant All on mysql.* to 'Tanjotuser1'@'localhost';
Grant All on mysql.* to 'Tanjotuser3'@'localhost';
select plugin from mysql.user where user='Tanjotuser1' and host='localhost';
plugin
mysql_native_password
mysql_native_password Expected
select plugin from mysql.user where user='Tanjotuser3' and host='localhost';
plugin
sha256_password
sha256_password Expected
**** Disconnecting the open sessions and dropping the created users
Drop user 'Tanjotuser1'@'localhost';
Drop user 'Tanjotuser3'@'localhost';
=============================================================================
Checking the password assignment using the update command on the user table
=============================================================================
**** Creating user with mysql_native_password plugin
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
UPDATE mysql.user SET Authentication_string='*0D3CED9BEC10A777AEC23CCC353A8C08A633045E' WHERE User='Tanjotuser1' AND Host='localhost';
FLUSH PRIVILEGES;
**** Creating user with sha256_password plugin
CREATE USER 'Tanjotuser3'@'localhost' IDENTIFIED WITH 'sha256_password';
UPDATE IGNORE mysql.user SET Authentication_string='*0D3CED9BEC10A777AEC23CCC353A8C08A633045E' WHERE User='Tanjotuser3' AND Host='localhost';
FLUSH PRIVILEGES;
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
set password='abcd';
select user(), current_user();
user() current_user()
Tanjotuser1@localhost Tanjotuser1@localhost
**** Disconnecting the open sessions and dropping the created users
Drop user 'Tanjotuser1'@'localhost';
Drop user 'Tanjotuser3'@'localhost';
# restart:
|