How to import text file to table with primary key as auto-increment
- by webworm
I have some bulk data in a text file that I need to import into a MySQL table. The table consists of two fields ..
ID (integer with auto-increment)
Name (varchar)
The text file is a large collection of names with one name per line ...
(example)
John Doe
Alex Smith
Bob Denver
I know how to import a text file via phpMyAdmin however, as far as I understand, I need to import data that has the same number of fields as the target table. Is there a way to import the data from my text file into one field and have the ID field auto-increment automatically?
Thank you in advance for any help.