How to find MySQL uptime from commandline

If you found this post helpful, kindly share it and show your support :)

You can use any of the below commands to find the MySQL uptime

  • mysqladmin version or mysqladmin version | grep -i uptime

Example:

~]$ mysqladmin  version
mysqladmin  Ver 9.0 Distrib 5.5.68-MariaDB, for Linux on x86_64
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Server version		5.5.68-MariaDB
Protocol version	10
Connection		Localhost via UNIX socket
UNIX socket		/var/lib/mysql/mysql.sock
Uptime:			44 days 14 hours 9 min 24 sec

Threads: 5  Questions: 2566552  Slow queries: 0  Opens: 76  Flush tables: 2  Open tables: 101  Queries per second avg: 0.666

~]$ mysqladmin  version | grep -i uptime
Uptime:			44 days 14 hours 15 min 29 sec
  • mysqladmin ver or mysqladmin ver | grep -i uptime
~]$ mysqladmin  ver
mysqladmin  Ver 9.0 Distrib 5.5.68-MariaDB, for Linux on x86_64
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Server version		5.5.68-MariaDB
Protocol version	10
Connection		Localhost via UNIX socket
UNIX socket		/var/lib/mysql/mysql.sock
Uptime:			44 days 14 hours 10 min 39 sec

Threads: 5  Questions: 2566596  Slow queries: 0  Opens: 76  Flush tables: 2  Open tables: 101  Queries per second avg: 0.666

~]$ mysqladmin  ver | grep -i uptime
Uptime:			44 days 14 hours 14 min 53 sec
  • mysqladmin status
~]$ mysqladmin status
Uptime: 3852956  Threads: 1  Questions: 2566794  Slow queries: 0  Opens: 76  Flush tables: 2  Open tables: 101  Queries per second avg: 0.666

Note :- Uptime is in seconds

Loading

Mohammed Noufal

I'm Mohammed Noufal, working as Server Admin for the last 10 years.  In my day-to-day life, l had to face different problems related to Web-hosting. On my website Errorlogz.com, you can find solutions for different Web-hosting-related problems. Sometimes, I spent hours searching/googling to find a solution. This inspired me to start a website that gives solutions to different Webhosting problems. This website includes basic Linux and windows commands, and different control panels like cPanel, Plesk, DirectAdmin, Webmin & so on. You can find solutions and or suggestions for different Web-hosting related problems from here. Hence I would like to say Errorlogz is your server protector.  I will be glad if Logdetect can help any one of the Server admins to find a solution to his problem.

You may also like...

Leave a Reply

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