The mysqladmin is the primary
tool for database administration. Using this utility, you can create, destroy,
and monitor your server and the databases it supports. You can issue multiple
commands at one time with the mysqladmin utility.
Its general format is
mysqladmin options command1 command2 ... commandn
To change the password for the MySQL server, use the following command:
mysqladmin -u username password 'newpassword'When you have a fresh MySQL installation up and running, the first thing you should do is change the root password.
You can create a new database using the following command:
mysqladmin -u username -p create databasenameThe -p option tells MySQL that you want to be prompted for the root password.
You can delete (drop) a database using the following command:
mysqladmin -u username -p drop databasename
The following command will perform a clean shutdown of the MySQL
database server:
mysqladmin -u username -p shutdown
The following command will reload all grant tables:
mysqladmin -u username -p reloadNote: flush-privileges command does the same.
The following command will display server version information:
mysqladmin -u username -p version
The mysqladmin utility is a
rich tool with handful of command line options. Use the following command
to get all the a list of all the commands and options it supports.
mysqladmin --help