如何将本地.SQL文件加载到MySQL? [英] How do I load a local .SQL file into MySQL?
问题描述
我的网络服务器上有一个56MB的文件,我想(我想)使用INFILE将文件名.SQL文件加载到mysql中。
I真的不想上传,因为这只需要很长的时间,但我想只使用系统上的本地文件导入到MySQL。这个文件包含了表创建指令,所以我不需要指定目标,只需要在文件中执行SQL就可以了。
最简单的方法是从命令提示符将其作为流传入。像这样:
mysql -u theuser -D thedatabase< filename.SQL
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.
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
这篇关于如何将本地.SQL文件加载到MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!