如何将1GB .sql文件导入WAMP/phpmyadmin [英] How to Import 1GB .sql file to WAMP/phpmyadmin

查看:96
本文介绍了如何将1GB .sql文件导入WAMP/phpmyadmin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将超过1GB大小的sql文件导入到localhost WAMP/phpmyadmin中的MySQL数据库中.但是phpmyadmin UI不允许导入这么大的文件.

I want to import over 1GB size sql file to MySQL database in localhost WAMP/phpmyadmin. But phpmyadmin UI doesn't allow to import such big file.

可以执行哪些操作,例如任何SQL查询以导入.sql文件?

What are the possible ways to do that such as any SQL query to import .sql file ?

谢谢

推荐答案

我怀疑您将能够通过phpmyadmin导入1 GB文件,但是您可以尝试通过增加php.ini中的以下值并重新启动Wamp. >

I suspect you will be able to import 1 GB file through phpmyadmin But you can try by increasing the following value in php.ini and restart the wamp.

post_max_size=1280M
upload_max_filesize=1280M
max_execution_time = 300 //increase time as per your server requirement. 

您还可以在命令提示符下尝试以下命令,根据您的MySQL安装,您的路径可能有所不同.

You can also try below command from command prompt, your path may be different as per your MySQL installation.

C:\wamp\bin\mysql\mysql5.5.24\bin\mysql.exe -u root -p db_name < C:\some_path\your_sql_file.sql

如果您的数据库比在my.ini中增加mysql的max_allowed_packet来避免MySQL server gone away错误大得多,则类似

if you have much bigger db than increase the max_allowed_packet of mysql in my.ini to avoid MySQL server gone away error, something like this

max_allowed_packet = 100M

这篇关于如何将1GB .sql文件导入WAMP/phpmyadmin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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