Home > Archive > MySQL Server Forum > November 2005 > importing sql statements









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author importing sql statements
Ike

2005-11-10, 8:23 pm

I have a text file with about 90,000 insert statements (as below). Is there
an easy way I can get these into my mysql database in one fell swoop? Can
anyone tell me how and perhaps that the syntax is? Thanks -Ike



INSERT INTO `lastnames` VALUES ('OFFENBERGER');


Markus Popp

2005-11-11, 7:23 am

If the table is already available, you can do it this way from the console:

shell> mysql -u [username] -p[password] [database name] < [text file name]

If the table doesn't already exist, you should create it first.

Markus


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com