Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006

    Unanswered: 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?


  2. #2
    Join Date
    Mar 2004
    from the mysql prompt:


  3. #3
    Join Date
    Sep 2009
    San Sebastian, Spain
    If your server is running on Linux you can also use OS commands to determine the start date of the process. For instance:

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

    # 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/ --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):

    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
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts