set max_allowed_packet setting on the target Azure mySQLFlexible Server

Imoh Etuk 0 Reputation points
2025-09-22T13:06:15.8966667+00:00

Can you please align the max_allowed_packet setting on the target Flexible Server to at least match the source server’s 64 MB value, so that the online migration with DMS can proceed?

Error - The server variable 'max_allowed_packet' has value: '67108864' on the source, and value: '16777216' on the target.

The source value must be less than or equal to the target value.

Impact:

  • Migration is currently blocked.
  • Manual dump/restore is not an option because we require online replication with minimal downtime.

Thank you for your assistance.

Azure Database Migration service
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pratyush Vashistha 5,125 Reputation points Microsoft External Staff Moderator
    2025-09-23T04:37:25.4566667+00:00

    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

    1. Navigate to your MySQL Flexible Server in the Azure Portal
    2. Go to Settings → Server parameters from the left menu
    3. Search for max_allowed_packet in the parameter list
    4. Change the value from 16777216 to 67108864 (or higher, like 134217728 for 128MB)
    5. Click Save - this will trigger a server restart

    Sharing screenshot for reference.

    User's image

    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:

    1. Have you tried the above steps already?
    2. What is the size of your largest table or blob data? This helps determine the optimal max_allowed_packet value.
    3. Are you experiencing any other DMS validation errors? Sometimes multiple parameters need adjustment.
    4. 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:

    1. Re-run the DMS validation to ensure this error is resolved
    2. Monitor for any additional parameter mismatches
    3. 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

    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

    User's image


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.