LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-20-2007, 03:34 PM   #1
Frank Soranno
Member
 
Registered: Jun 2005
Location: Scranton, Pa. USA
Distribution: Debian
Posts: 230

Rep: Reputation: 30
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
 
Old 08-20-2007, 03:58 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
"can't get stat"... sounds like a permissions problem. are the perms or the ownership too tight? does it even exist?
 
Old 08-20-2007, 05:45 PM   #3
Frank Soranno
Member
 
Registered: Jun 2005
Location: Scranton, Pa. USA
Distribution: Debian
Posts: 230

Original Poster
Rep: Reputation: 30
Tried as root also,
mysql> load data infile '/home/frank/Cus.cvs' into table Customers fields termin ated by '.' (Cus_id,Date,First_name,Last_name,Address,City,State,Zip,Home_phone, Cell_phone,Email,Notes);
ERROR 13 (HY000): Can't get stat of '/home/frank/Cus.cvs' (Errcode: 2)
mysql>
 
Old 08-20-2007, 07:35 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
MySQL is running as mysql Unix user.
You are logged into mysql as root mysql user.
Not the same thing as Unix root.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Snort's tcpdump into mysql toraghun Linux - Security 0 07-12-2006 08:06 AM
Importing data from /dev/ttyUSB0 RVDowning Mandriva 1 06-29-2006 08:06 PM
PHP / MySQL importing *.dmp dolvmin Programming 3 02-25-2006 03:51 AM
Mysql importing problem nepcw Linux - Newbie 4 03-22-2004 05:09 PM
mysql importing inq Robin01 Linux - Newbie 1 11-30-2003 09:12 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration