#Yii Solution: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
@admin
Updated November 30, 2013 ● 3,770 views
Yii channell is about Yii PHP Framework. Yii is a free, open-source Web application development framework written in PHP5 that promotes clean, dry design and encourages rapid development. It works to streamline your application development and helps to ensure an extremely efficient, extensible, and maintainable end product.
If you are a fellow Yii developer, join us! Do not hesitate to share your ideas. If you have a Yii product, you are welcome to share your creation here.
Check out Yii Framework official website.
This is a short guide to all fellow Yii developers out there or PHP developers in general. It took me a good hour to resolve the issue when all of a sudden, Oauth login is throwing out an error when it's trying to validate against the MySQL database.
The MySQL error is:
[exception.CDbException] exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away'
So obviously, it'a saying that the connection to MySQL has been lost. So this is all about connection timeout. There are several timeout configurations in MySQL.
Searching Google gave me a couple of suggestions from adjusting MySQL configurations such as max_allowed_packet, connect_timeout, etc. Some of the changes didn't workout until I tried to change wait_timeout.
My original wait_timeout was set to 20. I changed it to 60 seconds and it's back to normal again:
#Yii Solution: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Updated November 30, 2013 ● 3,770 views
Yii channell is about Yii PHP Framework. Yii is a free, open-source Web application development framework written in PHP5 that promotes clean, dry design and encourages rapid development. It works to streamline your application development and helps to ensure an extremely efficient, extensible, and maintainable end product.
If you are a fellow Yii developer, join us! Do not hesitate to share your ideas. If you have a Yii product, you are welcome to share your creation here.
Check out Yii Framework official website.
This is a short guide to all fellow Yii developers out there or PHP developers in general. It took me a good hour to resolve the issue when all of a sudden, Oauth login is throwing out an error when it's trying to validate against the MySQL database.
The MySQL error is:
So obviously, it'a saying that the connection to MySQL has been lost. So this is all about connection timeout. There are several timeout configurations in MySQL.
Searching Google gave me a couple of suggestions from adjusting MySQL configurations such as max_allowed_packet, connect_timeout, etc. Some of the changes didn't workout until I tried to change wait_timeout.
My original wait_timeout was set to 20. I changed it to 60 seconds and it's back to normal again:
wait_timeout=60