Not sure if this a problem with my MySQL or a conflict with Drupal Commerce. Since adding Drupal Commerce, I cannot add or edit a non-Commerce content types. I can still add/edit Commerce product types.
Here is the error that I get when trying to edit a standard 'Basic page' content type:
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {commerce_product_type}; Array ( ) in commerce_product_ui_commerce_product_type_info() (line 322 of /Applications/MAMP/htdocs/drupal/sites/all/modules/commerce/modules/product/commerce_product_ui.module).
If I try to add a new content type (not a Commerce type, but a regular content type), I get this error:
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT nt.* FROM {node_type} nt WHERE (disabled = :db_condition_placeholder_0) ORDER BY nt.type ASC; Array ( [:db_condition_placeholder_0] => 0 ) in _node_types_build() (line 706 of /Applications/MAMP/htdocs/drupal/modules/openid/node/node.module).
Comments
Comment #1
rfayThe most common reason for "Mysql server has gone away" is the max_packet_size setting. If you haven't updated that already, you'll want to.
http://drupal.org/node/186384#comment-3062828
You'll want to look at the Mysql docs as well: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
Comment #2
rszrama commentedhehe This error message always strikes me as a sad discovery by PHP. It's like it just lost its best friend and all it can bring itself to divulge is that the "MySQL server has gone away." I feel like it should use a sad face, too.
Comment #3
Sunflowers11 commentedThank you rfay. I set max_allowed_packet in startMySql.sh and that did the trick.
rszrama - funny comment.
Comment #4
rszrama commentedGlad it's fixed. : )
Comment #6
avrilev commentedWorked for me as well.
Thanks guys.
Avri
Comment #7
marthinal commentedIf you are using MAMP here is a good post to fix the problem:
http://forum.mamp.info/viewtopic.php?f=2&t=14115#p30606
Comment #8
rszrama commentedw00t! I just had this problem after updating MAMP and the fix worked great for me. First I actually had to copy the example MySQL .cnf file to conf/my.cnf and then edit the max_packet_size. All is well.
Comment #9
joshmillerAnd #7 was helpful for me as well :D
I did the following:
Then I restarted MAMP :D
Comment #10
news4u commentedthe above didnt worked for me since my server version does not support the variable
But i used
max_execution_time = 60
and it worked
But correct if am making mistakes or if it will later have evfect on my server
thank you
Comment #11
kenorb commentedRelated at SE (for possible solutions):
- General error: 2006 MySQL server has gone away
- MySQL error 2006: mysql server has gone away
- ERROR 2006 (HY000): MySQL server has gone away
- MySQL Server has Gone Away in Drupal 7