Find the answer to your Linux question:
Results 1 to 5 of 5
I've been trying to import data from a spreadsheet into mysql database,I have it in a cvs form with the right amount of fields as my database, but each time ...
  1. #1
    fvs
    fvs is offline
    Linux Newbie
    Join Date
    May 2005
    Location
    Scranton, Pa
    Posts
    166

    Importing data in mysql?

    I've been trying to import data from a spreadsheet into mysql database,I have it in a cvs form with the right amount of fields as my database, but each time I import into mysql I get an error message,

    mysql> load data infile '/home/frank/OpenOffice_Backup/Cus.cvs' into table Custome rs;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/home /frank/OpenOffice_Backup/Cus.cvs into table Customers' at line 1
    mysql> load data infile '/home/frank/OpenOffice_Backup/Cus.cvs' into table Custo mers;
    ERROR 13 (HY000): Can't get stat of '/home/frank/OpenOffice_Backup/Cus.cvs' (Err code: 2)
    Any help appreciated. Thanks

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,789
    As far as i know, this is not possible. The only way i think this may be possible would be through phpMyAdmin or something like this, but i think what you're best doing is passing it through sed to create the relevent insert statements to import this to SQL
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631

  4. #4
    fvs
    fvs is offline
    Linux Newbie
    Join Date
    May 2005
    Location
    Scranton, Pa
    Posts
    166
    Thanks for that tip, I'll try it and let you know how I made out.
    Thanks for replies guys.

  5. #5
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,789
    Quote Originally Posted by Franklin52 View Post
    Fine, prove me wrong then :P

    I'll make a note of that for future reference.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...