MySQL service uptime

5 (100%) 4 votes

MySQL service uptime

 

Sometimes, we need to check the uptime for MySQL in our server.

There are multiple method to check the uptime status of mysql server. Let see some of them.

  • mysqladmin status

[root@localhost ~]# mysqladmin -u root -p********* status
Uptime: 225921 Threads: 10 Questions: 18469911 Slow queries: 0 Opens: 12466 Flush tables: 1 Open tables: 64 Queries per second avg: 81.753

 

  • mysqladmin ver | grep -i uptime 

[root@localhost ~]# mysqladmin -u root -p********** ver | grep -i uptime
Uptime: 2 days 14 hours 48 min 13 sec

  • Query to show uptime

SHOW GLOBAL STATUS LIKE 'Uptime';

+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| Uptime        | 322477 |
+---------------+--------+
1 row in set (0.00 sec)

 

For any query or issue, feel free to discuss on http://discuss.eduguru.in

One thought on “MySQL service uptime

  • August 16, 2018 at 10:57 pm
    Permalink

    select TIME_FORMAT(SEC_TO_TIME(VARIABLE_VALUE ),’%Hh %im’) as Uptime
    from information_schema.GLOBAL_STATUS
    where VARIABLE_NAME=’Uptime’;

Leave a Reply

%d bloggers like this: