Professional Web Applications Themes

Changing the MySQL system date - MySQL

Hello, I'm working on an application running with MySQL 5.0. I would like to change the MySQL system date. I'm looking for an equivalent of the Oracle command "alter system set fixed_date='2007-04-02 22:23:24';". Is this possible with MySQL ? Thanks for your answers François....

  1. #1

    Default Changing the MySQL system date

    Hello,

    I'm working on an application running with MySQL 5.0.

    I would like to change the MySQL system date. I'm looking for an
    equivalent of the Oracle command "alter system set
    fixed_date='2007-04-02 22:23:24';".

    Is this possible with MySQL ?

    Thanks for your answers

    François.

    francois.dussauge@gmail.com Guest

  2. #2

    Default Re: Changing the MySQL system date

    >I'm working on an application running with MySQL 5.0. 

    If you look at the output of mysqlbinlog, you'll see it can play
    back a history of queries with a fake time set using SET TIMESTAMP,
    which takes a UNIX timestamp as a value. This works only on a
    particular connection. I'm not sure what privileges it requires
    to use it.

    SET TIMESTAMP=unix_timestamp('1999-04-01 12:34:56');
    SELECT now();
    returns '1999-04-01 12:34:56'


    Gordon Guest

  3. #3

    Default Re: Changing the MySQL system date

    On 6 avr, 02:07, org (Gordon Burditt) wrote: 


    >
    > If you look at the output of mysqlbinlog, you'll see it can play
    > back a history of queries with a fake time set using SET TIMESTAMP,
    > which takes a UNIX timestamp as a value. This works only on a
    > particular connection. I'm not sure what privileges it requires
    > to use it.
    >
    > SET TIMESTAMP=unix_timestamp('1999-04-01 12:34:56');
    > SELECT now();
    > returns '1999-04-01 12:34:56'[/ref]

    Thanks for this indication.

    To change the system date of Mysql, i must do this + run mysqlserver
    with the "--sysdate-is-now" option.
    But when i start mysqld with this option, mysql doesn't start
    ("[ERROR] /usr/local/libexec/mysqld: unknown option '--sysdate-is-
    now'"). However, I looked at the mysql 5 doentation, and they say
    it is the thing to do :(

    Do you have any idea?

    Thanks

    francois.dussauge@gmail.com Guest

  4. #4

    Default Re: Changing the MySQL system date

    >> >I would like to change the MySQL system date. I'm looking for an 
    >> 
    >>
    >> If you look at the output of mysqlbinlog, you'll see it can play
    >> back a history of queries with a fake time set using SET TIMESTAMP,
    >> which takes a UNIX timestamp as a value. This works only on a
    >> particular connection. I'm not sure what privileges it requires
    >> to use it.
    >>
    >> SET TIMESTAMP=unix_timestamp('1999-04-01 12:34:56');
    >> SELECT now();
    >> returns '1999-04-01 12:34:56'[/ref]
    >
    >Thanks for this indication.
    >
    >To change the system date of Mysql, i must do this + run mysqlserver
    >with the "--sysdate-is-now" option.[/ref]

    I've never seen a reason to use sysdate() rather than now(), (although
    using sysdate() seems to have the potential for ing up
    tion), so I don't need that option.
     

    What version is the manual, vs. what version is your mysqld? There's
    a lot of difference between, say, 5.0.4 and 5.0.37 (I'm running 5.0.37
    and tested the above SET TIMESTAMP code on it.)

    Gordon Guest

Similar Threads

  1. Changing date format
    By mohammed.naghman@gmail.com in forum MySQL
    Replies: 2
    Last Post: October 31st, 10:00 AM
  2. changing language date format
    By Gert in forum FileMaker
    Replies: 3
    Last Post: November 10th, 09:51 PM
  3. compare date on cd to system date
    By Rowan Ferguson in forum Macromedia Director Lingo
    Replies: 2
    Last Post: October 2nd, 04:41 AM
  4. Changing the date format
    By Ioannis in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: August 5th, 07:42 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139