I have a query which can enter data into mysql database. However,i would like to have the time of an entry entered as well and that entered time should correspond to server time.I am using Ubuntu Server 12.04 LTS below is the code i am using to enter data into the table(it is embedded in a script)
mysql -uroot -pmysql --local-infile database -e"LOAD DATA LOCAL INFILE A.txt INTO TABLE TABLEA columns terminated by '|'"
I have created the table to have 3 columns with one for the time with datatype labled as timestamp. How can i edit my code so that it can also insert the local time. I am using a LAMP stack. To clarify further, if my table is populated like
> ip mac time > 10.0.0.97 00 14 2A 2F 72 FE 2012-09-09 23:11:05
and my textfile contains the data
10.0.0.97|00 14 2A 2F 72 FF 10.0.0.98|00 21 33 RT W3 TT
and i run the script now, i would expect it to appear in the database as
> ip mac > time > 10.0.0.97 00 14 2A 2F 72 FE 2012-09-09 23:11:05 > 10.0.0.97 00 14 2A 2F 72 FF 2013-18-09 16:11:11 > 10.0.0.98 00 21 33 RT W3 TT 2013-18-09 16:11:11