Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Mysql Problem With –mysqlimport And Timestamp

forums forums SQLyog Sync tools, Migration, Scheduled Backup and Notifications Mysql Problem With –mysqlimport And Timestamp

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #9195
      Redg
      Member

      😕

      I am running MySql 4.1 on Fedora Core 3

      I have a script being kicked of by crontab that looks like this

      [root@localhost] # mysqlimport –fields-terminated-by=”,” –lines-terminate-by=”rn” –local databasename /path/nameoftable.restoffilename

      The file “nameoftable.restoffilename” has 12 fields of data in it which are seperated by a comma. The MySQL table has 13 fields of data in it. The 13th field of data is a field type “TIMESTAMP” NULL. (note i have also tried NOT NULL).

      When the data imports into my table the 13 field always appears as 0000-00-00 00:00:00

      Does anyone know how i can get the timestamp field to populate its field with the timestamp of when the record was added????????

      I HAVE BEEN AT THIS ONE FOR DAYS….

      Does anyone have a clue???

    • #19074
      peterlaursen
      Participant

      Yes …

      simply set default CURRENT_TIMESTAMP and time of creation wil be inserted.

      A more advanced one:

      timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP

      will do as the first, but when ANY row is updated the timestamp field will be updated too.

      Refer to the MySQL documentation for more details. Search for “CURRENT_TIMESTAMP”

      Was that the answer to your question ??

Viewing 1 reply thread
  • You must be logged in to reply to this topic.