Managing a Database with mysqladmin

The mysqladmin utility can be used to perform a wide range of administrative operations on a MySQL database. It is usually run from a command-line prompt.

When invoked, you should pass mysqladmin a number of options and commands to tell it how to run, and what to do.

How to Use mysqladmin

The following is the basic syntax for mysqladmin:

mysqladmin [options] cmd1 [cmd1_opts] cmd2 [cmd2_opts] ...

Remember that you may need to prefix mysqladmin with the path to your mysql/bin/ directory where it resides. This will be true for the other utilities as well.

Here are a couple of sample invocations:

$ mysqladmin -u root -p create newdb

$ /usr/local/mysql/bin/mysqladmin -u root -p variables
						

The first of the preceding ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.