How to know the MySQL uptime from commandline

In some unusual situation, we need to look into the up-time for MySQL in your server. So here am giving you three ways to check MySQL version along with the up-time of MySQL procedure.

Method 1

mysqladmin  version

Mysql version 1

Method 2

This command is similar to “mysqladmin version”

# mysqladmin  ver

mysql version2

If you only want to know the MySQL up-time, then you can use grep command with the above command.

# mysqladmin  version | grep -i uptime
# mysqladmin  ver | grep -i uptime


Method 3

This command also provide MySQL up-time along with running threads and queries, but this up-time is recorded in seconds:

mysql version 4

That’s all.

One thought on “How to know the MySQL uptime from commandline

  1. Hello,

    after login to MySQL when we check uptime it gives blank output. Please find below details:

    Server version: 5.0.77-log Source distribution
    Protocol version: 10
    Connection: Localhost via UNIX socket
    Uptime: ————–

    I am logged in with super privileges.

    Currently DB is up and running fine. Kindly suggest.


Leave a Reply

Your email address will not be published. Required fields are marked *