.csv
file and i have to import it in MySQL table
.So i mean six column in table with today date.
time stamp
as datatype
and CURRENT_TIMESTAMP
in default
.But it occurs query:- Invalid column count in CSV input on line 1.
Please guide me.
This means the number of column in your csv and table is not same. If you want to set default value of any column you have to keep this value empty but you have to mention this column. For example: if you want to insert 3 columns having a default value for 1 column named 'created' your csv file should look like this:
Please remove first row which describes your table structure. I mean do not use the following instead of the above:
And finally run the following sql if current timestamp is not set:
UPDATE `table` SET edate = current_timestamp;
Here put your table name it 'table' phrase.
You can use DEFAULT constraints to set the timestamp:
ALTER TABLE
MODIFY edate datetime DEFAULT CURRENT_TIMESTAMP
ALTER TABLE
MODIFY edate datetime DEFAULT ON UPDATE CURRENT_TIMESTAMP