您的位置:首页 > 编程语言 > PHP开发

How to upload / import a mysql phpmydadmin database of more than 2MB

2014-08-21 15:50 423 查看

There is a couple of ways.1) Split your SQL file into multiple 2MB chunks

OR

2) update your php.ini file with the following (only works on dedicated/local servers - any server you have root on or ones that allow php.ini to be override)(要修改好几个地方哦)
Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M
Change to: ( or any size you want but it will depend on your server resources )
post_max_size = 35M
upload_max_filesize = 35M
max_execution_time = 5000
max_input_time = 5000(这个在程序脚本里动态设置比较好。。)
memory_limit = 1000M
3) If you do have root run a command line
mysql -u database_name -p -D database_name < file
max_input_time此变量可以以秒为单位对通过POST、GET以及PUT方式接收数据时间进行限制。如果应用程序所运行环境处在低速链路上,则需要增加此值以适应接收数据所需的更多时间。max_input_time = 90max_execution_time变量max_execution_time设置了在强制终止脚本前PHP等待脚本执行完毕的时间,此时间以秒计算。当脚本进入了一个无限循环状态 时此变量非常有用。然而,当存在一个需要很长时间完成的合法活动时(例如上传大型文件),这项功能也会导致操作失败。在这样的情况下必须考虑将此变量值增 加,以避免PHP在脚本正在执行某些重要过程的时候将脚本关闭。max_execution_time = 90
[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: