The ‘mysqladmin’ is a client that helps perform administrative operations. It can also be used to check the server's configuration and current status, to create and drop databases, and much more.
The mysqladmin can be invoked by using the below command −
shell> mysqladmin [options] command [command-arg] [command [command-arg]] ...
Let us see some of the commands which mysqladmin supports. Some commands take an argument following the command name.
create db_name
This command creates a new database named db_name.
drop db_name
It deletes the database named db_name and all its tables.
extended-status
It displays the server status variables and their values.
flush-hosts
It flushes all information in the host cache.
flush-privileges
It reloads the grant tables. It is same as reload.
kill id,id,...
It kills the server threads. If multiple thread ID values are provided, then there should be no spaces in the list.
password new_password
It sets a new password. This changes the password to new_password so that the account used by user is the one with mysqladmin to connect to the server.
ping
This command checks whether the server is available. The return status from mysqladmin is 0 if the server is running, and it is 1 if it is not.
processlist
It shows a list of active server threads. This is similar to the output of the SHOW PROCESSLIST statement.
reload
It reloads the grant tables.
refresh
It flushes all tables and closes and opens log files.
shutdown
It stops the server.
version
It displays the version information from the server.