Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySql Error 'max_allowed_packet' bytes during import SQL script on database hosted on AWS RDS

I was facing an issue during import SQL file on MySql database which is on AWS RDS, during import SQL file initial table was imported then suddenly it shows an error.

enter image description here

I know this error and I can solve this by increasing max_allowed_packet size in MySQL config but is not local Mysql is AWS RDS show how can I do?

like image 462
Krupal Patel Avatar asked Jul 18 '18 07:07

Krupal Patel


2 Answers

After reviewing this article https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithParamGroups.html I understand what I have to do and how.

Here are the following steps.

1) Go to RDS page and click on "Parameter groups" text located in the left navigation.

enter image description here

2) Now create a new group by clicking on "Create parameter group" orange button.

enter image description here

3) Fillup parameter group form "Parameter group family" should be MySql version of your RDS instance than "Group name" and "Description" whatever you want.

enter image description here

4) New "Parameter group" was created as "test" now edit it and increase "max-allowed-packet" by entering "10000000" (10 MB) value should be in Bytes after entering value don't forgot to click on "Save changes" button and make sure value is between 1024 Bytes to 1073741824 Bytes (1073 MB)

enter image description here

5) Now you can see your changes by click on "Preview changes" button.

6) Now we have to change "Parameter group" of our RDS instance. SO, modify an instance and select "Parameter groups" which we created.

enter image description here

7) Now after modify RDS instance you should to Reboot it to apply your changes.

like image 141
Krupal Patel Avatar answered Sep 25 '22 00:09

Krupal Patel


Go to RDS, select Parameter Groups and create new group/edit existing one. Search for max_allowed_packet and enter new value for it. Attach this parameter group to RDS instance.

like image 23
Justinas Avatar answered Sep 26 '22 00:09

Justinas