将更大的SQL文件导入MySQL [英] Importing larger sql files into MySQL

查看:321
本文介绍了将更大的SQL文件导入MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个400MB的大型sql备份文件.我正在尝试使用WAMP-> import将该文件导入MySQL数据库,但是由于许多原因(例如上载文件大小太大),导入未成功.因此,我继续进行一些工作,并对WAMP下的PHP和MySQL配置进行了一些更改.所做的更改是

I have a 400MB large sql backup file. I'm trying to import that file into MySQL database using WAMP->import, but the import was unsuccessful due to many reasons such as upload file size is too large and so on. So, i've gone ahead and made a few changes to the config PHP and MySQL settings under WAMP. Changes made are

Under WAMP->MySQL->my.ini

    max_allowed_packet = 800M
    read_buffer_size = 2014K

 Under WAMP->PHP->PHP.ini

    max_input_time = 20000
    memory_limit = 128M

我的问题是,这是使用WAMP-> import导入这么大的sql文件的正确方法吗? 如果是这样,我是否对配置文件进行了正确的更改?以上变量允许的最大值是多少?

My question is, Is this the right way to import such a large sql files using WAMP->import? If so, did i make the right changes to the config files? What are the maximum values allowed for the above variable?

推荐答案

您可以通过以下命令行方式导入大文件:

You can import large files this command line way:

mysql -h yourhostname -u username -p databasename < yoursqlfile.sql

这篇关于将更大的SQL文件导入MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆