newbie question - how to create new table from a text file?
newbie question - how to create new table from a text file?
am 17.08.2006 03:10:23 von xz
Is there a GUI utility which can create a new table in my mysql
database from a 50 million-record text file? I want mysql to get the
data into the database as whatever it can - varchar etc. I can change
columns later to double.... unless mysql is intelligent enough to see
that the field in the text file is numeric.
Thanks for any help....
jason shohet
Re: newbie question - how to create new table from a text file?
am 17.08.2006 04:30:13 von Bill Karwin
xz wrote:
> Is there a GUI utility which can create a new table in my mysql
> database from a 50 million-record text file? I want mysql to get the
> data into the database as whatever it can - varchar etc. I can change
> columns later to double.... unless mysql is intelligent enough to see
> that the field in the text file is numeric.
Typically one creates a real MySQL table with a CREATE TABLE statement,
or else using the GUI methods in MySQL Administrator or similar tool.
Then load data from the text file into that table using the LOAD DATA
INFILE statement. See http://dev.mysql.com/doc/refman/5.0/en/load-data.html
There doesn't seem to be a GUI method for doing this. You have to learn
the syntax for specifying field separators, etc.
There are quite a few idiosyncrasies to the LOAD DATA statement. You'd
be wise to try it with a small, representative subset of data, and learn
how to deal with the various problems you might have.
You can also look at Navicat, which is a commercial product that may
provide a GUI to load your textual data.
http://www.navicat.com/
Regards,
Bill K.
Re: newbie question - how to create new table from a text file?
am 17.08.2006 19:13:22 von xz
Navicat is great Bill! Wow - great wizard for importing with fixed
field lengths, thanks.
Now I am trying to figure out a way of having the table with the data
stored on an external hard drive, instead of local on my laptop (any
ideas?) I created a separate posting for this a few minutes ago in
this ng.
Bill Karwin wrote:
>
> You can also look at Navicat, which is a commercial product that may
> provide a GUI to load your textual data.
> http://www.navicat.com/
>
> Regards,
> Bill K.
Re: newbie question - how to create new table from a text file?
am 18.08.2006 01:46:04 von Jim Langston
Can't you simply create a new database and point it to your external hard
drive? Wouldn't it be like D: or E: or something?
I'm not sure if this would require a reinstall of mysql or not.
"xz" wrote in message
news:1155834801.978775.85360@i3g2000cwc.googlegroups.com...
> Navicat is great Bill! Wow - great wizard for importing with fixed
> field lengths, thanks.
> Now I am trying to figure out a way of having the table with the data
> stored on an external hard drive, instead of local on my laptop (any
> ideas?) I created a separate posting for this a few minutes ago in
> this ng.
>
> Bill Karwin wrote:
>>
>> You can also look at Navicat, which is a commercial product that may
>> provide a GUI to load your textual data.
>> http://www.navicat.com/
>>
>> Regards,
>> Bill K.
>
Re: newbie question - how to create new table from a text file?
am 18.08.2006 07:41:05 von Bill Karwin
Jim Langston wrote:
> Can't you simply create a new database and point it to your external hard
> drive? Wouldn't it be like D: or E: or something?
>
> I'm not sure if this would require a reinstall of mysql or not.
It does not require a reinstall of MySQL, but it does require shutting
MySQL down, changing an option in the configuration file to define where
the datadir is, and then restarting the MySQL service.
Another option is to leave the datadir in its default location, but make
some (or all) databases located elsewhere, by using symbolic links. See
http://dev.mysql.com/doc/refman/5.0/en/windows-symbolic-link s.html.
Regards,
Bill K.