None of this is working for me. Because in /etc/my.conf there is only :

set-variable = max_connections=500
log-slow-queries
safe-show-database


And while using ssh mysql --max_allowed_packet=1000M the same error comes.