使用腻子在AWS RDS上上传大型mysql数据库-'MySQL服务器已消失' [英] Uploading large mysql database on AWS RDS using putty - 'MySQL server has gone away'

查看:115
本文介绍了使用腻子在AWS RDS上上传大型mysql数据库-'MySQL服务器已消失'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Amazon Web服务,并且已经设置了EC2和RDS,并安装了apache,php,mysql,phpmyadmin.

Im using Amazon Web services and I've setup EC2 and RDS and installed apache, php, mysql, phpmyadmin.

我可以导入小的sql文件(我也设置了worpdress并为此-fine导入了sql db),但是当我尝试使用腻子导入200mg的sql文件时,我得到了

I can import small sql files (I also setup worpdress and imported a sql db for that -fine) but when I try to import a 200mg sql file using putty I get

第186行的错误2006(HY000):MySQL服务器已消失'

ERROR 2006 (HY000) at line 186: MySQL server has gone away'

进行了一些研究之后,似乎在 DB参数组中增加 max_allowed_pa​​cket wait_timeout net_read_timeout 可能会有所帮助,它没有(我做了更改后确实重启了,我也使用RightScale仪表板将这些设置为它们的最大允许值).

After doing some research it seemed increasing max_allowed_packet, wait_timeout and net_read_timeout in DB Parameter Groups would help but it didnt (I did reboot after making changes, I also set those to their maximum allowed values using RightScale dashboard).

还有什么我应该意识到的可能是导致这种情况的原因吗?

Is there anything else I should be aware of that might be causing this?

我也没有运气尝试过bigdump.php.

I also tried bigdump.php with no luck.

我认为大量的人使用aws上传大型mysql数据库,这有点让我发疯.

I presume loads of people upload large mysql databases using aws so this is kinda driving me crazy.

推荐答案

我遇到了同样的问题:

  1. 转到您的RDS信息中心,然后点击参数组.
  2. 点击创建数据库参数组,将其命名为"LargeImport"(确保您选择的数据库参数组族与您的实例版本匹配)并编辑参数.
  3. 增加"LargeImport"上的" max_allowed_pa​​cket "以适应您的导入大小(有效值为1024-1073741824).
  4. 增加" wait_timeout "参数以适应您的导入大小. (有效值为1-31536000秒).
  5. 保存您的更改.
  6. 点击左侧列中的实例,然后选择您的实例.
  7. 点击实例操作,然后选择修改.
  8. 参数组更改为新的"LargeImport"组,然后单击继续.
  9. 点击修改数据库实例".
  10. 更改完成后,再次单击实例操作,然后重新启动实例.
  1. Go to your RDS Dashboard and click Parameter Groups.
  2. Click Create DB Parameter Group, name it something like 'LargeImport', (making sure the DB Parameter Group Family you select matches your instance version) and edit the parameters.
  3. Increase the 'max_allowed_packet' on 'LargeImport' to accommodate your import size (Valid values are 1024-1073741824).
  4. Increase the 'wait_timeout' parameter to accommodate your import size. (Valid values are 1-31536000 seconds).
  5. Save your changes.
  6. Click Instances in the left column and select your instance.
  7. Click Instance Actions and choose Modify.
  8. Change the Parameter Group to your new 'LargeImport' group and click Continue.
  9. Click 'Modify DB Instance'.
  10. Once the change has completed, click Instance Actions again and reboot your instance.

实例重新启动后,您应该可以进行较大的sql导入.

Once your instance has rebooted, you should be able to do larger sql imports.

完成导入后,将实例参数组切换回默认参数组,然后再次重新启动.

希望这会有所帮助.

这篇关于使用腻子在AWS RDS上上传大型mysql数据库-'MySQL服务器已消失'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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