jim.davidson Posted November 11, 2009 Share Posted November 11, 2009 I'm running MySQl 4.1.22 I'm trying to import data into a table. I don't get an error, but nothing imports. Table is simple, two fields client_number varchar(10) client_name varchar(100) Here is the data "0101","AAUD" "0102","ABACUS" "0103","ADVANCED PLUMBING" "0104","ADVANCED PROCESSES" "0113","ANDRE INSURANCE" "0114","ANDERSON CONSTRUCTION" "0115","ANDERSON INSURANCE" "0116","ARKWOOD PRODUCTS" "0117","ARNONI DEVELOPMENT" "0118","ASOCIATED ACCITUARIES" "0119","AUGUST TRUCKING" "2603","ZAMMERILLA" Here is my query LOAD DATA LOCAL INFILE "C:\client3.txt" INTO TABLE clients FIELDS TERMINATED BY ',' ENCLOSED BY '"'( client_number, client_name ); Here's the result I get Inserted rows: -1 (Query took 0.0004 sec) What am I doing wrong? I'm trying to teach myself, but I'm stuck! Any help will be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/181133-solved-need-help-importing-data-from-txt-file/ Share on other sites More sharing options...
DavidAM Posted November 11, 2009 Share Posted November 11, 2009 I've never done this, and I have no test environment here at work, but, since you are on a Windows platform, do you need to specify that the LINES TERMINATED BY "\r\n"? Quote Link to comment https://forums.phpfreaks.com/topic/181133-solved-need-help-importing-data-from-txt-file/#findComment-955751 Share on other sites More sharing options...
jim.davidson Posted November 11, 2009 Author Share Posted November 11, 2009 Thanks for the advice David. Like I said I'm learning as I go. I decided to go a different route. I used the create table and insert into commands to create a populate the table. Again, thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/181133-solved-need-help-importing-data-from-txt-file/#findComment-955785 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.