Hello Imoh Etuk!
Thank you for reaching out with your Azure Database for MySQL Flexible Server migration question! This is a common configuration issue that can be easily resolved by adjusting the max_allowed_packet parameter on your target Flexible Server.
The error occurs because Azure Database Migration Service (DMS) requires the target server's max_allowed_packet value to be greater than or equal to the source server's value. Your source has 64MB (67108864 bytes) while your target has 16MB (16777216 bytes).
You can use following methods to fix your issue. Let me know if you have already tried these?
Using Azure Portal
- Navigate to your MySQL Flexible Server in the Azure Portal
- Go to Settings → Server parameters from the left menu
- Search for
max_allowed_packetin the parameter list - Change the value from
16777216to67108864(or higher, like134217728for 128MB) - Click Save - this will trigger a server restart
Sharing screenshot for reference.
You can also use the follow Azure CLI command to fix this:
# Set max_allowed_packet to 64MB (67108864 bytes)
az mysql flexible-server parameter set \
--resource-group <your-resource-group> \
--server-name <your-server-name> \
--name max_allowed_packet \
--value 67108864
After the change, verify the setting:
-- Connect to your MySQL Flexible Server and run:
SHOW VARIABLES LIKE 'max_allowed_packet';
To ensure we address all aspects of your migration:
- Have you tried the above steps already?
- What is the size of your largest table or blob data? This helps determine the optimal
max_allowed_packetvalue. - Are you experiencing any other DMS validation errors? Sometimes multiple parameters need adjustment.
- What MySQL version are you migrating from and to? Version differences might require additional parameter alignments.
Once you've updated the max_allowed_packet parameter and the server has restarted:
- Re-run the DMS validation to ensure this error is resolved
- Monitor for any additional parameter mismatches
- Proceed with your online migration
The migration should now proceed successfully with minimal downtime as required. Please let me know if you encounter any additional issues or need clarification on any of these steps!
Useful Reference Links
- https://docs.azure.cn/en-us/dms/tutorial-mysql-azure-external-online-portal-physical
- Configure server parameters in Azure Database for MySQL Flexible Server
- Azure Database Migration Service MySQL migration guide
- MySQL Flexible Server server parameters
- Troubleshoot Azure Database Migration Service
Please "Accept as Answer" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.
Thanks
Pratyush