Skip to main content

UserOption

Enum UserOption 

Source
pub enum UserOption {
Show 20 variants Password(String), AuthPlugin { plugin: String, by: Option<String>, as_: Option<String>, }, AccountLock, AccountUnlock, PasswordExpire, PasswordExpireDefault, PasswordExpireNever, PasswordExpireInterval(u32), PasswordHistory(u32), PasswordHistoryDefault, PasswordReuseInterval(u32), PasswordReuseIntervalDefault, PasswordRequireCurrent, PasswordRequireCurrentOptional, PasswordRequireCurrentDefault, FailedLoginAttempts(u32), PasswordLockTime(u32), PasswordLockTimeUnbounded, Comment(String), Attribute(String),
}
Expand description

MySQL user/role option specifications

These options control authentication, account locking, password policies, and metadata for MySQL users and roles.

§Authentication Options

  • `Password` - Set user password (IDENTIFIED BY)
  • `AuthPlugin` - Use authentication plugin (IDENTIFIED WITH)

§Account Locking Options

  • `AccountLock` - Lock the account (prevent login)
  • `AccountUnlock` - Unlock the account

§Password Expiration Options

  • `PasswordExpire` - Expire password immediately
  • `PasswordExpireDefault` - Use default expiration policy
  • `PasswordExpireNever` - Password never expires
  • `PasswordExpireInterval` - Expire after N days

§Password History Options

  • `PasswordHistory` - Prevent reuse of last N passwords
  • `PasswordHistoryDefault` - Use default history policy

§Password Reuse Options

  • `PasswordReuseInterval` - Allow reuse after N days
  • `PasswordReuseIntervalDefault` - Use default reuse policy

§Password Requirement Options

  • `PasswordRequireCurrent` - Require current password to change
  • `PasswordRequireCurrentOptional` - Current password optional
  • `PasswordRequireCurrentDefault` - Use default requirement policy

§Failed Login Handling Options

  • `FailedLoginAttempts` - Lock after N failed attempts
  • `PasswordLockTime` - Lock for N days after failed attempts
  • `PasswordLockTimeUnbounded` - Lock indefinitely

§Metadata Options

  • `Comment` - User comment/description
  • `Attribute` - User attribute (JSON format)

Variants§

§

Password(String)

IDENTIFIED BY - set user password

§

AuthPlugin

IDENTIFIED WITH - use authentication plugin

Fields

§plugin: String

Plugin name

§by: Option<String>

BY clause (authentication string)

§as_: Option<String>

AS clause (hashed authentication string)

§

AccountLock

ACCOUNT LOCK - prevent user from logging in

§

AccountUnlock

ACCOUNT UNLOCK - allow user to log in

§

PasswordExpire

PASSWORD EXPIRE - expire password immediately

§

PasswordExpireDefault

PASSWORD EXPIRE DEFAULT - use default expiration policy

§

PasswordExpireNever

PASSWORD EXPIRE NEVER - password never expires

§

PasswordExpireInterval(u32)

PASSWORD EXPIRE INTERVAL N DAY - expire after N days

§

PasswordHistory(u32)

PASSWORD HISTORY N - prevent reuse of last N passwords

§

PasswordHistoryDefault

PASSWORD HISTORY DEFAULT - use default history policy

§

PasswordReuseInterval(u32)

PASSWORD REUSE INTERVAL N DAY - allow password reuse after N days

§

PasswordReuseIntervalDefault

PASSWORD REUSE INTERVAL DEFAULT - use default reuse policy

§

PasswordRequireCurrent

PASSWORD REQUIRE CURRENT - require current password to change password

§

PasswordRequireCurrentOptional

PASSWORD REQUIRE CURRENT OPTIONAL - current password optional

§

PasswordRequireCurrentDefault

PASSWORD REQUIRE CURRENT DEFAULT - use default requirement policy

§

FailedLoginAttempts(u32)

FAILED_LOGIN_ATTEMPTS N - lock account after N failed login attempts

§

PasswordLockTime(u32)

PASSWORD_LOCK_TIME N - lock account for N days after failed attempts

§

PasswordLockTimeUnbounded

PASSWORD_LOCK_TIME UNBOUNDED - lock account indefinitely

§

Comment(String)

COMMENT - user comment/description

§

Attribute(String)

ATTRIBUTE - user attribute in JSON format

Trait Implementations§

Source§

impl Clone for UserOption

Source§

fn clone(&self) -> UserOption

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UserOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for UserOption

Source§

fn eq(&self, other: &UserOption) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for UserOption

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.