Here we are creating user with name manish and password for manish is password;
1 | CREATE USER 'manish'@'localhost' IDENTIFIED BY 'password'; |
Creating a user and force user to change password at first login for that PASSWORD EXPIRE is used.
1 | CREATE USER 'manish'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE; |
Creating a user and expiring the password after 180 days, PASSWORD EXPIRE INTERVAL 180 DAY is used
1 | CREATE USER 'manish'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE INTERVAL 180 DAY; |
Creating a user and never expire the password, PASSWORD EXPIRE NEVER is used
1 | CREATE USER 'manish'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; |
Creating a user and expire the password as defined in system variable default_password_lifetime
to use this PASSWORD EXPIRE DEFAULT is used
1 | CREATE USER 'manish'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE DEFAULT; |