Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By aruntvla on
Hello friends ,
When i edit a content type in drupal 7 its showing an error
" PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {menu_links} WHERE menu_name = :menu_name AND module = :module AND link_path = :path; Array ( [:menu_name] => management [:module] => system [:path] => admin ) in toolbar_get_menu_tree() (line 286 of C:\xampp\htdocs\LifeEcho\modules\toolbar\toolbar.module). "
anyone know whats the reason for this error.
Regards
Arun
Comments
Check you mysql running or
Check you mysql running or not.
try restarting mysql server
For LINUX Machine
"sudo /etc/init.d/mysql restart'
OR you can set 'max_allowed_packet=500M' for mysql to solved it and not repeat in future.
Tushar Shantaram Bodake
PDOException: SQLSTATE[HY000]: General error:
I have set
ini_set('max_allowed_packet','500M');
in settings.php , but no change in above error .some times this page also showing following error ,
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT alias FROM {url_alias} WHERE source = :source AND language IN (:language, :language_none) ORDER BY language ASC, pid DESC; Array ( [:source] => user/1/edit [:language] => en [:language_none] => und ) in drupal_lookup_path() (line 150 of C:\xampp\htdocs\LifeEcho\includes\path.inc).
If you are on LINUX
If you are on LINUX machine
Edit following file.
/etc/mysql/my.cnf to set 'max_allowed_packet = 512M'
Restart MYSQL
Remove your previous changes from settings.php
For more details
http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html
Tushar Shantaram Bodake
Disable the toolbar module
I disabled the toolbar module and it is now working fine for me. I am anyways using the Admin menu module for administration menu.