Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble uploading/importing files to MySQL server 1

Status
Not open for further replies.

MishaD

Programmer
May 31, 1999
2
US
I keep getting an error message that the file I'm trying to upload cannot be found. Could someone please reply with an example using the proper syntax for importing data using the LOAD DATA command? <br>
<br>
I tried:<br>
<br>
LOAD DATA LOCAL INFILE 'test_db.csv' INTO TABLE admintest<br>
FIELDS TERMINATED BY ',' ENCLOSED BY '"'<br>
LINES TERMINATED BY '\r';
 
Are you trying to get the data from a file on the local hard drive, or from another data source?
 
I'm trying to get the file from one of my local drives and send it via telnet to a remote server where I have a MySQL database hosted. It may be to that the version of MySQL on the server isn't recent enough. The MySQL documentation says LOAD DATA LOCAL works with version 3.22.6, whereas the version on the server is MySQL 3.22.21.
 
If you telnetted to the remote host where your mysql server lives, and ran "mysql" there, it will only find files on that machine (not the one you're telnetting from). Try ftp'ing the file up to the remote machine first, or try a client like XmySQL, which I've found useful for one-off type admin/access stuff (loading data, creating db's etc). You may also be able to run mysql monitor on your local machine and connect to the remote db. In fact, I'm sure you can, but I've never had to, so I don't really know how :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top