mysqladmin
mysqladmin is a client for performing administrative operations. You can use it to check the server's configuration and current status, to create and drop databases, and more.[1]
Documentation
- man 1 'mysqladmin' [EN]
Syntax
mysqladmin [PARAMETER] SUBCOMMAND [ARGUMENT] [SUBCOMMAND [ARGUMENT] ...]
Subcommands & Parameters
- Global parameters
- mysqladmin supports the following parameters:
- -p[PASSWORD], --password[=PASSWORD]
- The PASSWORD to use when connecting to the server. If you use the short option form (-p, you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, you are prompted for one.
- -u USER, --user=USER
- The MySQL USER to use when connecting to the server.
- create DATABASE
- Create a new database named DATABASE.
- drop DATABASE
- Delete the database named DATABASE and all its tables.
- flush-privileges
- Reload the grant tables (same as reload).
- password PASSWORD
- Set a new password. This changes the password to PASSWORD for the account that you use with mysqladmin for connecting to the server. Thus, the next time you invoke mysqladmin (or any other client program) using the same account, you will need to specify the new password.
- status
- Display a short server status message.
Examples
- Change the MySQL password for the user 'root'
mysqladmin --user='root' --password password '********'
- Create a new database called 'mydb'
mysqladmin --user='alex' --password create 'mydb'
- Drop the database called 'mydb'
mysqladmin --user='alex' --password drop 'mydb'
References
- ↑ man 1 'mysqladmin'