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

mysql3

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 Response

  1. Sanket Sawant
    Sanket Sawant at | | Reply

    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.

    Regards,
    Sanket

Leave a Reply

Register to Get FREE Offers

Why Pay for Software when you can GET it for FREE

JOIN US TONIGHT!