Link to home
Start Free TrialLog in
Avatar of doctorbill
doctorbillFlag for United Kingdom of Great Britain and Northern Ireland

asked on

update records with csv file

MySQL table column names:

column1, column2, column3
1                1               1
2                2               3


a CSV file has these columns names and new values
I just want to update column2 for the time being with new values
I would also like to be able to either update existing values or add (append) new ones to this column2
I use phpmyadmin
Avatar of David Favor
David Favor
Flag of United States of America image

This will be complex to do through phpMyAdmin.

In fact, using .csv file data for UPDATEs rather than INSERTs is complex. I don't thing there's no real native support for this.

Likely you'll have to write a script to ingest your .csv data + build a .sql file doing each UPDATE, then ingest your .sql file into phpMyAdmin.
I am not quiet sure about this but I wanted to try with LOAD DATA INFILE. As I get chance to test it, I'd post here. Mostly load-data for column two and write col2 as SET col2=...
Avatar of doctorbill

ASKER

I have managed to get it working with Navicat
Thanks all
ASKER CERTIFIED SOLUTION
Avatar of doctorbill
doctorbill
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial