pub enum ClientCommand {
CreateDb(CreateDbArgs),
DropDb(DropDbArgs),
ShowDb(ShowDbArgs),
ShowDbPrivs(ShowDbPrivsArgs),
EditDbPrivs(EditDbPrivsArgs),
CreateUser(CreateUserArgs),
DropUser(DropUserArgs),
PasswdUser(PasswdUserArgs),
ShowUser(ShowUserArgs),
LockUser(LockUserArgs),
UnlockUser(UnlockUserArgs),
}Variants§
CreateDb(CreateDbArgs)
Create one or more databases
DropDb(DropDbArgs)
Delete one or more databases
ShowDb(ShowDbArgs)
Print information about one or more databases
If no database name is provided, all databases you have access will be shown.
ShowDbPrivs(ShowDbPrivsArgs)
Print user privileges for one or more databases
If no database names are provided, all databases you have access to will be shown.
EditDbPrivs(EditDbPrivsArgs)
Change user privileges for one or more databases. See edit-db-privs --help for details.
This command has two modes of operation:
-
Interactive mode: If nothing else is specified, the user will be prompted to edit the privileges using a text editor.
You can configure your preferred text editor by setting the
VISUALorEDITORenvironment variables.Follow the instructions inside the editor for more information.
-
Non-interactive mode: If the
-pflag is specified, the user can write privileges using arguments.The privilege arguments should be formatted as
<db>:<user>+<privileges>-<privileges>where the privileges are a string of characters, each representing a single privilege. The characterAis an exception - it represents all privileges.The character-to-privilege mapping is defined as follows:
s- SELECTi- INSERTu- UPDATEd- DELETEc- CREATED- DROPa- ALTERI- INDEXt- CREATE TEMPORARY TABLESl- LOCK TABLESr- REFERENCESA- ALL PRIVILEGES
If you provide a database name, you can omit it from the privilege string,
e.g. edit-db-privs my_db -p my_user+siu is equivalent to edit-db-privs -p my_db:my_user:siu.
While it doesn’t make much of a difference for a single edit, it can be useful for editing multiple users
on the same database at once.
Example usage of non-interactive mode:
Enable privileges `SELECT`, `INSERT`, and `UPDATE` for user `my_user` on database `my_db`:
`mysqladm edit-db-privs -p my_db:my_user:siu`
Enable all privileges for user `my_other_user` on database `my_other_db`:
`mysqladm edit-db-privs -p my_other_db:my_other_user:A`
Set miscellaneous privileges for multiple users on database `my_db`:
`mysqladm edit-db-privs my_db -p my_user:siu my_other_user:ct``CreateUser(CreateUserArgs)
Create one or more users
DropUser(DropUserArgs)
Delete one or more users
PasswdUser(PasswdUserArgs)
Change the MySQL password for a user
ShowUser(ShowUserArgs)
Print information about one or more users
If no username is provided, all users you have access will be shown.
LockUser(LockUserArgs)
Lock account for one or more users
UnlockUser(UnlockUserArgs)
Unlock account for one or more users
Trait Implementations§
Source§impl Clone for ClientCommand
impl Clone for ClientCommand
Source§fn clone(&self) -> ClientCommand
fn clone(&self) -> ClientCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CommandFactory for ClientCommand
impl CommandFactory for ClientCommand
Source§impl Debug for ClientCommand
impl Debug for ClientCommand
Source§impl FromArgMatches for ClientCommand
impl FromArgMatches for ClientCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for ClientCommand
impl Parser for ClientCommand
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Source§impl Subcommand for ClientCommand
impl Subcommand for ClientCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for ClientCommand
impl RefUnwindSafe for ClientCommand
impl Send for ClientCommand
impl Sync for ClientCommand
impl Unpin for ClientCommand
impl UnwindSafe for ClientCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more