I had the exact same problem. I tried all the above and more and max_allowed_packet was not updated from the default value of ~1MB. I had been restarting mysql using Ampps (on Windows 11). Eventually I found out that two mysql.exe processes was running. By shutting both down in Task manager -> Details -> mysql.exe and then restarting MySQL in Ampps the max_allowed_packet update was registered. Now it showed: 67108864 (set to 64M in my.ini)