| 1 |
SELECT password_last_changed into @passwordchanged from mysql.user where host='localhost' and user='x_root'; |
| 2 |
create user foo@localhost; |
| 3 |
alter user foo@localhost password expire; |
| 4 |
create user xplugin@localhost identified by 'xplugin'; |
| 5 |
grant all on *.* to xplugin@localhost; |
| 6 |
alter user xplugin@localhost password expire; |
| 7 |
|
| 8 |
Test: Expired password with no support for sandbox mode (should fail) |
| 9 |
Got expected error: Your password has expired. To log in you must change it using a client that supports expired passwords. (code 1862) |
| 10 |
ok |
| 11 |
|
| 12 |
Test: Expired password with support for sandbox mode (should succeed) |
| 13 |
send Mysqlx.Connection.CapabilitiesSet { |
| 14 |
capabilities { |
| 15 |
capabilities { |
| 16 |
name: "client.pwd_expire_ok" |
| 17 |
value { |
| 18 |
type: SCALAR |
| 19 |
scalar { |
| 20 |
type: V_BOOL |
| 21 |
v_bool: true |
| 22 |
} |
| 23 |
} |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
Mysqlx.Ok { |
| 29 |
} |
| 30 |
|
| 31 |
NOTICE: Account password expired |
| 32 |
Login OK |
| 33 |
ok |
| 34 |
Test: try connecting with non-x_root user when its password expird and x_root user password expired,expect password expired notice |
| 35 |
alter user x_root@localhost password expire; |
| 36 |
Application terminated with expected error: Your password has expired. To log in you must change it using a client that supports expired passwords. (code 1862) |
| 37 |
ok |
| 38 |
Test: try connecting with Expired password using x_root user and expect password expire notice |
| 39 |
send Mysqlx.Connection.CapabilitiesSet { |
| 40 |
capabilities { |
| 41 |
capabilities { |
| 42 |
name: "client.pwd_expire_ok" |
| 43 |
value { |
| 44 |
type: SCALAR |
| 45 |
scalar { |
| 46 |
type: V_BOOL |
| 47 |
v_bool: true |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
Mysqlx.Ok { |
| 55 |
} |
| 56 |
|
| 57 |
NOTICE: Account password expired |
| 58 |
Login OK |
| 59 |
ok |
| 60 |
Test: try connecting with non-x_root user when its password expird and x_root user password expired,expect password expired notice |
| 61 |
send Mysqlx.Connection.CapabilitiesSet { |
| 62 |
capabilities { |
| 63 |
capabilities { |
| 64 |
name: "client.pwd_expire_ok" |
| 65 |
value { |
| 66 |
type: SCALAR |
| 67 |
scalar { |
| 68 |
type: V_BOOL |
| 69 |
v_bool: true |
| 70 |
} |
| 71 |
} |
| 72 |
} |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
Mysqlx.Ok { |
| 77 |
} |
| 78 |
|
| 79 |
NOTICE: Account password expired |
| 80 |
Login OK |
| 81 |
ok |
| 82 |
Test: try connecting with x_root user whose password expired with wrong password and expect invalid user or password error |
| 83 |
send Mysqlx.Connection.CapabilitiesSet { |
| 84 |
capabilities { |
| 85 |
capabilities { |
| 86 |
name: "client.pwd_expire_ok" |
| 87 |
value { |
| 88 |
type: SCALAR |
| 89 |
scalar { |
| 90 |
type: V_BOOL |
| 91 |
v_bool: true |
| 92 |
} |
| 93 |
} |
| 94 |
} |
| 95 |
} |
| 96 |
} |
| 97 |
|
| 98 |
Mysqlx.Ok { |
| 99 |
} |
| 100 |
|
| 101 |
Got expected error: Access denied for user 'x_root'@'localhost' (using password: YES) (code 1045) |
| 102 |
ok |
| 103 |
set password for x_root@localhost = ''; |
| 104 |
# restart: --disconnect_on_expired_password=off |
| 105 |
Test: expect expired Notice for connection |
| 106 |
NOTICE: Account password expired |
| 107 |
RUN select user(),current_user() |
| 108 |
While executing select user(),current_user(): |
| 109 |
Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) |
| 110 |
Mysqlx.Ok { |
| 111 |
msg: "bye!" |
| 112 |
} |
| 113 |
ok |
| 114 |
set password for x_root@localhost = ''; |
| 115 |
# restart: --skip-disconnect_on_expired_password |
| 116 |
Test: expect expired Notice for connection |
| 117 |
NOTICE: Account password expired |
| 118 |
RUN select user(),current_user() |
| 119 |
While executing select user(),current_user(): |
| 120 |
Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) |
| 121 |
Mysqlx.Ok { |
| 122 |
msg: "bye!" |
| 123 |
} |
| 124 |
ok |
| 125 |
NOTICE: Account password expired |
| 126 |
RUN select user(),current_user(); |
| 127 |
Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) |
| 128 |
RUN create database xplugin; |
| 129 |
Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) |
| 130 |
RUN set password = 'xplugin' |
| 131 |
|
| 132 |
0 rows affected |
| 133 |
RUN create database xplugin |
| 134 |
|
| 135 |
1 rows affected |
| 136 |
RUN drop database xplugin |
| 137 |
|
| 138 |
0 rows affected |
| 139 |
RUN select user(),current_user() |
| 140 |
user() current_user() |
| 141 |
xplugin@localhost xplugin@localhost |
| 142 |
0 rows affected |
| 143 |
RUN alter user xplugin@localhost password expire |
| 144 |
|
| 145 |
0 rows affected |
| 146 |
Mysqlx.Ok { |
| 147 |
msg: "bye!" |
| 148 |
} |
| 149 |
ok |
| 150 |
# restart: --disconnect_on_expired_password |
| 151 |
NOTICE: Account password expired |
| 152 |
RUN select user(),current_user(); |
| 153 |
Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) |
| 154 |
RUN create database xplugin; |
| 155 |
Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) |
| 156 |
RUN set password = 'xplugin' |
| 157 |
|
| 158 |
0 rows affected |
| 159 |
RUN create database xplugin |
| 160 |
|
| 161 |
1 rows affected |
| 162 |
RUN drop database xplugin |
| 163 |
|
| 164 |
0 rows affected |
| 165 |
RUN select user(),current_user() |
| 166 |
user() current_user() |
| 167 |
xplugin@localhost xplugin@localhost |
| 168 |
0 rows affected |
| 169 |
RUN alter user xplugin@localhost password expire |
| 170 |
|
| 171 |
0 rows affected |
| 172 |
Mysqlx.Ok { |
| 173 |
msg: "bye!" |
| 174 |
} |
| 175 |
ok |
| 176 |
connecting... |
| 177 |
Got expected error: Your password has expired. To log in you must change it using a client that supports expired passwords. (code 1862) |
| 178 |
ok |
| 179 |
NOTICE: Account password expired |
| 180 |
send Mysqlx.Sql.StmtExecute { |
| 181 |
stmt: "create database xplugin;" |
| 182 |
} |
| 183 |
|
| 184 |
Mysqlx.Error { |
| 185 |
severity: ERROR |
| 186 |
code: 1820 |
| 187 |
msg: "You must reset your password using ALTER USER statement before executing this statement." |
| 188 |
sql_state: "HY000" |
| 189 |
} |
| 190 |
|
| 191 |
Got expected error: You must reset your password using ALTER USER statement before executing this statement. (code 1820) |
| 192 |
Mysqlx.Ok { |
| 193 |
msg: "bye!" |
| 194 |
} |
| 195 |
ok |
| 196 |
drop user foo@localhost; |
| 197 |
drop user xplugin@localhost; |
| 198 |
update mysql.user set password_last_changed = @passwordchanged where host = 'localhost' and user='x_root'; |
| 199 |
flush privileges; |