I am using Drupal 7 and i am getting MySQL server has gone away error in my current site. By doing Google i figured out that i need to increase some of the parameters of my.ini file


Is there any way that I can write this in Drupals settings.php?

1 Answer 1


No, those need to be set in your MySQL server's my.ini/my.cnf file.

Those settings can't be changed on the fly from any process (PHP, Apache, even MySQL itself), you need to set them in the .ini/.cnf file and then restart the MySQL server for the changes to take effect.

  • 3
    my.ini in Windows, my.cnf in *nix.
    – Citricguy
    Sep 6, 2012 at 11:50
  • @Citricguy Cheers, I've added that in
    – Clive
    Sep 6, 2012 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.