38 users online (1 members and 37 guests)  


  Results 1 to 4 of 4

Related

  1. mysql & php new line problem    Forum: PHP Forum
    Replies: 6
  2. Replies: 2
  3. add timestamp into filename    Forum: CGI Perl Forum
    Replies: 1
  4. mysql query / function problem....    Forum: Databases
    Replies: 7
  5. Perl dbi with mysql problem    Forum: CGI Perl Forum
    Replies: 1
  1. #1
    Redg's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2005
    Posts
    2

    MySql problem --with -- mysqlimport and TIMESTAMP


    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="\r\n" --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 13th 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???

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: MySql problem --with -- mysqlimport and TIMESTAMP

    do you have anymore code to show us?

  3. #3
    Redg's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2005
    Posts
    2

    Re: MySql problem --with -- mysqlimport and TIMESTAMP

    Thanks for you reply... the exact code is as follows:


    [root@localhost]# mysqlimport --fields-terminated by="," --lines-terminated-by="\r\n" --local s8700 /mnt/winbox/ds1_f.batonrouge_08A10A

    This imports a file from /mnt/winbox/ - The file is called ds1_f.batonrouge_08A10A.

    The table its imported into is ds1_f in database s8700.

    The file being imported has 12 columns which are seperated by a comma. My table has 13 columns. The 13th columns has these properties.

    Field date_added
    Type timestamp
    Collation latin1_swedish_ci
    Null YES
    Default \N

  4. #4
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: MySql problem --with -- mysqlimport and TIMESTAMP

    sorry, i cant help with this problem, due to little knowledge about sql

    sry