How to find MySQL server uptime?

You can use mysqladmin utility to find MySQL server's uptime. Run the following command from command line.

mysqladmin -u<user> -p<password> -h<host name/IP> version

Replace <user> with MySQL username, <password> with password (you can enter invisible password later by using -p only and entering password at the password prompt). The command above not only tells you server's version but also tells you server uptime.

Here is sample output from my server

> mysqladmin -uroot -p -hlocalhost  version
Enter password: ********
mysqladmin  Ver 8.41 Distrib 5.0.84, for Win32 on ia32
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version          5.0.84-community-nt
Protocol version        10
Connection              localhost via TCP/IP
TCP port                3306
Uptime:                 14 hours 39 min 25 sec

Threads: 9  Questions: 5109  Slow queries: 0  Opens: 47  Flush tables: 1  Open t
ables: 0  Queries per second avg: 0.097

Did this tutorial help a little? How about buy me a cup of coffee?

Buy me a coffee at ko-fi.com

Please feel free to use the comments form below if you have any questions or need more explanation on anything. I recommend thoroughy testing on a production-like test system first before moving to production.