1

I have a 56mb file on my web server, and I would like to (I think) use INFILE to load a filename.SQL file into mysql.

I don't really want to upload it because that will just take too long, but I would like to just use the local file on the system to import into mysql. The file contains the table creation instructions already so I don't need to specify the target, just execute the SQL as is in the file.

2
  • Do you have access to a shell on the server? You need to use the mysql client program to import a sql file. Commented Jul 8, 2011 at 19:15
  • mysql (connection options) < file.sql Commented Jul 8, 2011 at 19:17

2 Answers 2

4

login to mysql command line environment and do:

mysql> source file_name.sql

Sign up to request clarification or add additional context in comments.

Comments

2

The easiest way is to pass it in as a stream from the command prompt. Something like this:

mysql -u theuser -D thedatabase < filename.SQL

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.