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!

Import an .sql file into mysql

Status
Not open for further replies.

frumunda1

Technical User
May 24, 2003
4
US
When I try to use the source filename.sql in the mysql console I get an error 22 something about outfile disabled.

Like orace you can type @test.sql to import the contents of the test.sql file into the buffer. How do you do this in mysql?

Thanks

Confused.
 
There is a section in the help file for MySql that tells you exactly how to import the SQL file. You may want to check the web site wince they have a copy of the help file there. Sorry I don't remember what setction it is in, I think it is in 3.X

Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
You should be able to (from the MySQL> prompt) do MySQL>source /path/to/your/test.sql

It's usually as simple as that ?

Good Luck
 
I tried the source <filename command. Even the batch mode option. I keep getting an error regarding &quot;Source file not found&quot; and &quot;Outfile disabled&quot;.

 
What OS?

on Linux/Unix you should (from the mysql prompt) do:

mysql>source /path/to/your.sql (Note: no < required here)

Or from the OS command prompt do:
User@Linux$>mysql < /path/to/your.sql ... prompted for password maybe ...
 
I got it. Thanks for the help. I am using Winblows to play with this thing and had the .sql file on the root drive of an XP PRO machine. I think it was a permission thing. Anyway, I modified the batch file to logon with a username and password into the mysql, run the statements, and logout.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top