I found this SQL query to display MySQL uptime:
SHOW GLOBAL STATUS LIKE 'Uptime';
But I get the value 2059555.
How I can convert it to days?
Officially, development of MySQL began in 1994. Shortly after that, on 23 May 1995, the first version of MySQL was released and the three developers founded MYSQL AB.
To look for NULL values, you must use the IS NULL test. The following statements show how to find the NULL phone number and the empty phone number: mysql> SELECT * FROM my_table WHERE phone IS NULL; mysql> SELECT * FROM my_table WHERE phone = ''; See Section 3.3.
By using the assignment operator (“=”), you can set any value of a column to NULL by using the Update Statement.
On MySQL prompt type this, On the last line we will find Uptime
mysql>\s
Also if needed to write a query. This will give you in hours and minutes
select TIME_FORMAT(SEC_TO_TIME(VARIABLE_VALUE ),'%Hh %im') as Uptime
from information_schema.GLOBAL_STATUS
where VARIABLE_NAME='Uptime'
Note: Above version 5.7 use performance_schema instead of information_schema
You can run SHOW GLOBAL STATUS;
to find the value for Uptime
, represented in seconds. Divide by 86,400 (60 * 60 * 24) to convert to days.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With