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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL import issue

Status
Not open for further replies.

stevebanks

Programmer
Mar 30, 2004
93
Hi everyone,

Wonder if you can help? I have a 100Mb SQL file that i need to import into a mySQL db on our server.. Every line is in the format:

Code:
INSERT INTO table VALUES (a,b,c,d,e,f);

How would I go about it, i'm a relative newbie to MySQL etc and am struggling!

Thanks in advance

Steve
 
You could use something like:
[tt]
mysql [-u username] [-ppassword] [-h hostname] [dbname] <sqlfile.sql
[/tt]
 
As in:

Code:
 mysql> [-u root] [-p pass123] [-h localhost] [dbone] c:\files\sql.sql;

When i do this it comes back
"ERROR: unknown command \i"
"ERROR: unknown command \_"
twice?

Any suggestions?

Thanks
 
I was describing a shell command, the brackets indicating optional arguments. An example would be:
[tt]
mysql -u myusername -pmypassword -h mydbserver dbone <c:\files\sql.sql
[/tt]
the -h argument is only needed if you're connecting to a remote server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top