mysqladmin - MySQL Admin Tool

This section describes how to use MySQL admin tool to check server status and other admin tasks.

If you want to know whether your MySQL server is alive, you can use the "mysqladmin" program in a command window as shown in this tutorial. Enter the MySQL "root" password when prompted.

herong> mysqladmin -u root -p ping
mysqld is alive

The "mysqld is alive" message tells you that your MySQL server is running ok. If your MySQL server is not running, you will get a "connect ... failed" message.

You can also use "mysqladmin" program to check version number of your MySQL server in a command window as shown in the following tutorial:

herong> mysqladmin -u root -p version
mysqladmin  Ver 8.0.17 for macos10.14 on x86_64
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Server version    8.0.17
Protocol version  10
Connection    Localhost via UNIX socket
UNIX socket    /tmp/mysql.sock
Uptime:      2 days 15 hours 19 min 35 sec

Threads: 3  Questions: 17  Slow queries: 0  Opens: 124  Flush tables: 3  ...

If you want to know what else you can do with "mysqladmin", you should run the "-?" option:

herong> mysqladmin -?
...

Administration program for the mysqld daemon.
Usage: mysqladmin [OPTIONS] command command....
  -c, --count=#       Number of iterations to make. This works with -i
                      (--sleep) only.
...

Where command is a one or more of: (Commands may be shortened)
  create databasename   Create a new database
  debug                 Instruct server to write debug information
  drop databasename     Delete a database and all its tables
  extended-status       Gives an extended status message
  flush-hosts           Flush all cached hosts
  flush-logs            Flush all logs
  flush-status          Clear status variables
  flush-tables          Flush all tables
  flush-threads         Flush the thread cache
  flush-privileges      Reload grant tables (same as reload)
  kill id,id,...        Kill mysql threads
  password new-password Change old password to new-password,
                        MySQL 4.1 hashing.
  old-password new-password
                        Change old password to new-password
                        in old format.
  ping                  Check if mysqld is alive
  processlist           Show list of active threads in server
  reload                Reload grant tables
  refresh               Flush all tables and close and open logfiles
  shutdown              Take server down
  status                Gives a short status message from the server
  start-slave           Start slave
  stop-slave            Stop slave
  variables             Prints variables available
  version               Get version info from server

Table of Contents

 About This Book

 JDBC (Java Database Connectivity) Introduction

 JDK (Java SE) Installation

MySQL Installation on Windows

 MySQL Installation on macOS

 MySQL Installation on Windows

mysqladmin - MySQL Admin Tool

 mysql - Command Line Tool

 Creating Database and User with MySQL Monitor

 MySQL JDBC Driver (MySQL Connector/J)

 MySQL - PreparedStatement

 MySQL - Reference Implementation of JdbcRowSet

 MySQL - JBDC CallableStatement

 MySQL CLOB (Character Large Object) - TEXT

 MySQL BLOB (Binary Large Object) - BLOB

 Using Connection Pool with JDBC

 Archived Tutorials

 References

 Full Version in PDF/EPUB