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.