If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Query - When MySQL server/databas has been started

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-05-10, 15:30
sholtan sholtan is offline
Registered User
 
Join Date: Jul 2006
Posts: 5
Query - When MySQL server/databas has been started

I'm trying to find out when MySQL DATABASE/SERVER started and how long it has been running. Is there query or command in that I can use to check this? Is there more than one option to find this out and is it same for all MySQL versions or diffferent from version to version?

Thanks
Reply With Quote
  #2 (permalink)  
Old 09-05-10, 15:49
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
from the mysql prompt:

Code:
\s
Reply With Quote
  #3 (permalink)  
Old 09-07-10, 10:55
it-iss.com it-iss.com is offline
Registered User
 
Join Date: Sep 2009
Location: San Sebastian, Spain
Posts: 620
If your server is running on Linux you can also use OS commands to determine the start date of the process. For instance:

Code:
ps -fu mysql
This will return the process information including the process ID and start time.

Code:
# ps -fu mysql
UID        PID  PPID  C STIME TTY          TIME CMD
mysql     3436  3385  0 Sep06 ?        00:02:22 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/mysqld.pid --skip-external-locking --port=3306 --socket=/var/lib/
If the start time (STIME) is not sufficient in this case you can have a look at the process directory (using root):

Code:
ls -lad /proc/3436
dr-xr-xr-x 6 mysql mysql 0 Sep  6 21:45 /proc/3436
This directory is created when the process gets created and one exists for each process running on the server.
__________________
Ronan Cashell
Senior Oracle/MySQL DBA
http://www.it-iss.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On