Comment 5 for bug 1533482

Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :

"ALTER USER mytest@localhost IDENTIFIED WITH auth_pam PASSWORD EXPIRE NEVER"" is not changing password_lifetime=0.

mysql> ALTER USER mytest@localhost IDENTIFIED WITH auth_pam PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.00 sec)

mysql> select user,host,password_expired,password_lifetime,plugin from mysql.user where user='mytest';
+--------+-----------+------------------+-------------------+----------+
| user | host | password_expired | password_lifetime | plugin |
+--------+-----------+------------------+-------------------+----------+
| mytest | localhost | Y | NULL | auth_pam |
+--------+-----------+------------------+-------------------+----------+
1 row in set (0.00 sec)

mysql>

btw even if we ALTER USER with "PASSWORD EXPIRE NEVER" need to update password_expired column manually.

mysql> ALTER USER mytest@localhost PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.00 sec)

mysql> select user,host,password_expired,password_lifetime,plugin from mysql.user where user='mytest';
+--------+-----------+------------------+-------------------+----------+
| user | host | password_expired | password_lifetime | plugin |
+--------+-----------+------------------+-------------------+----------+
| mytest | localhost | Y | 0 | auth_pam |
+--------+-----------+------------------+-------------------+----------+
1 row in set (0.00 sec)

mysql> \q
Bye
root@ramesh-550P5C-550P7C:/home/ramesh/workdir/PS-mysql-5.7.10-1rc1-linux-x86_64-debug# ./bin/mysql -A -S/home/ramesh/workdir/PS-mysql-5.7.10-1rc1-linux-x86_64-debug/socket.sock --plugin-dir=/home/ramesh/workdir/PS-mysql-5.7.10-1rc1-linux-x86_64-debug/lib/mysql/plugin -umytest -pqwqw -e'select @@version' --connect-expired-password;
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1820 (HY000) at line 1: You must reset your password using ALTER USER statement before executing this statement.
root@ramesh-550P5C-550P7C:/home/ramesh/workdir/PS-mysql-5.7.10-1rc1-linux-x86_64-debug#