List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 28 1999 2:39am
Subject:Re: Baffled by a text import
View as plain text  
At 9:20 PM -0400 4/27/1999, Vinny Stoessel wrote:
>I'm trying import a sample database
>into mysql.
>These are the instructions that came with the package:
>MSAMPLEASC is a collection of the same tables
>in a special delimited ASC format:
>   CHR(1) - field delimiter
>   CHR(2) - record delimiter
>When I run mysqlimport...
>>mysqlimport test TRACK.TXT
>>mysqlimport: Error: Table 'test.TRACK' doesn't exist, when using table: TRACK
>obviously I don't know what I'm doing. I'm reading the docs
>but seem to be missing something.
>Mysql 3.22.21 Irix 6.3. Any pointers are appreciated.

(1) The table TRACK into which you are importing data must already exist.
From the error message, it looks like you haven't created it yet.

(2) The field and record delimiters are \001 and \002.  From my
cursory reading of the manual, there is no way to represent these
characters to MySQL.  I think you'll need to change them to something
else.  Tab and newline are good choices, unless those appear in your
field values.  You could transliterate characters like this:

	% tr "\001\002" "\011\012" < TRACK.TXT > TRACK.TXT2

Then load TRACK.TXT2:

	% mysqlimport test TRACK.TXT2

You'll still need to create the TRACK table first, of course.

Also, read the man page for tr first.  Its syntax is a little different
on some systems.

Paul DuBois, paul@stripped
Northern League Chronicles:
Baffled by a text importVinny Stoessel28 Apr
  • Re: Baffled by a text importPaul DuBois28 Apr
    • Linux 2.2/ MySQL 3.21 compile probsSuresh Rajagopalan28 Apr
      • Linux 2.2/ MySQL 3.21 compile probsMichael Widenius28 Apr