[TriLUG] mySQL Data Import

Alan Porter porter at trilug.org
Wed May 11 17:34:51 EDT 2005


Myrhillion wrote:
> As silly as this may sound, have you tried contacting their admins?
> They might be willing to load it for you, if you provide the commands 
> that have been given as well.
> This may be more expeditious than writing a php/mysql script to cycle 
> through manually. heh


I have been known to take a dumped file and edit it in 'vi', turning
each line into an SQL 'insert' command.

For example, search for beginning of line and replace with INSERT INTO TABLE.
Search for tabs and replace with quote-comma-quote.  Search for end of
line and replace with semicolon.  Once you get the INSERT commands looking
right, then execute the file with something like 'mysql < dump.txt'.

Sure, it's old school, but it works.

Alan






.




More information about the TriLUG mailing list