|
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
Please feel free to use the comments form below if you have any questions or need more explanation on anything.
|
Tags
mysql, database, server, uptime, mysqladmin,
Popular Searches
php, linux, mysql, ubuntu, mysql mysql, tools, install mysql, gearman, source code, java
more>> |
Comments (write a comment):
one of the most easiest trick in the book, but is also one of the most important codes out there for webmasters.
Posted by: Remote Data Centre on Dec 02, 2011