Determining Max_Allowed_Packet setting for MySQL

Posted on 2011-10-15
Last Modified: 2012-05-12
I'm trying to mitigate a potential risk where my hosting server reboots, and the MySQL service is restarted and the default Max_Allowed_Packet setting is not increased to allow my software to handle large enough documents.

Without changing this setting, the application fails to load new documents, or correctly create the historical copy when a new revision is released.

I tried putting the command line in the My.ini file of max_allowed_packet = 10485760000;  and rebooting the server, but the MySQL service didn't restart automatically so I had to start it using the MySQL Configuration Tool that rewrites the my.ini file.

I can manually change the setting by entering SET GLOBAL max_allowed_packet = 10485760000; at the mysql command prompt through Navicat (MySQL editing tool), and then everything works as it should.

I either need to figure out how to make sure this setting is applied at the virtual server in case the data center has to recreate my server instance, or access this setting through VBA in my application and write in some code that checks for the proper setting before allowing the user to release a document.

I tried to hunt for that setting in the registry, but I don't think MySQL stores that setting there.

Anyone have any ideas how I should handle this?
Question by:DavidSmithstein
    LVL 24

    Expert Comment

    When you set the variable via mysql client or navicat, did you verify it via SHOW VARIABLES? states that 1073741824 or 1GB is the highest possible value for it.  Chances are it got set to 1GB only.  Try using that number in your my.ini.

    LVL 24

    Accepted Solution

    In case you have documents > 1G, you will need to split them up.  See the links at

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now