22, August 2008

MySQL server has gone away - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: MySQL server has gone away
« previous next »
Pages: [1] Print

Author Topic: MySQL server has gone away  (Read 637 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6300
38626 credits
Members referred : 374


It's time to use PHP5!


« on: Mar 08, 2008, 04:42:39 PM »

I have some strange behavior:

I select ~750 email addresses from the database

store them in an array

send some small mail message to them

and query the database again and get this error.


I tried persistent connections but still get this error, do I need to reconnect?


Last blog : Create custom backups from your website using cURL
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6300
38626 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Mar 08, 2008, 04:56:17 PM »

just read some artciles and maybe this setting is the problem?

I have this setting:
mysql.connect_timeout   60   60

maybe I need to raise this value for that script?

how about the auto connection feature?

my_bool reconnect = 1;
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);

Note that this script works fine woth ~500 email addresses

Thanks


Last blog : Create custom backups from your website using cURL
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8020
41077 credits
Members referred : 3



« Reply #2 on: Mar 08, 2008, 07:26:32 PM »

First of all are you sure that the server works fine when this happens? I mean when you get that error, other connections work fine?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6300
38626 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Mar 08, 2008, 07:54:00 PM »

First of all are you sure that the server works fine when this happens? I mean when you get that error, other connections work fine?
it's only while sending these mails and only the database connection, the problem exists since the number of subscribers grows above the 550 or something


Last blog : Create custom backups from your website using cURL
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8020
41077 credits
Members referred : 3



« Reply #4 on: Mar 08, 2008, 08:28:36 PM »

Looks like a configuration problem, but anyway have you tried to create a new connection when you query? I guess it wont be a problem for an action like this.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6300
38626 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Mar 08, 2008, 08:36:30 PM »

Looks like a configuration problem, but anyway have you tried to create a new connection when you query? I guess it wont be a problem for an action like this.
I will try that tomorrow (I post only once a day some newsletter), will say you have never this kind of problems while sending mails to all members from this forum?


Last blog : Create custom backups from your website using cURL
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8020
41077 credits
Members referred : 3



« Reply #6 on: Mar 09, 2008, 12:13:21 PM »

No I never had problems with such scripts, but I always take the whole query (I mean I get all the records I need at once)

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6300
38626 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Mar 09, 2008, 12:18:32 PM »

strange just run the script and added some new db connection code before the query and get again the same error...

what about this setting:
mysql.connect_timeout   60   60


Last blog : Create custom backups from your website using cURL
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8020
41077 credits
Members referred : 3



« Reply #8 on: Mar 13, 2008, 11:30:01 PM »

I am not really sure about this. Did you finally solved this prob?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6300
38626 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: Mar 13, 2008, 11:40:56 PM »

I am not really sure about this. Did you finally solved this prob?
no, will check the same script on some other server first


Last blog : Create custom backups from your website using cURL
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6300
38626 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Mar 18, 2008, 01:18:18 PM »

strange the website is now on some other (shared) server and works fine Sad

Maybe I have changed something in the Mysql settings, don't care next month I get a new server Cheesy

btw. I think it's not an bad idea to send a daily newsletter to ~1000 email addresses via some shared hosting service lol


Last blog : Create custom backups from your website using cURL
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7640
Tags : mysql connection server Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: MySQL server has gone away
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Aug 22, 2008, 02:44:09 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.084
Total Topics: 7.439
Total Members: 3.807
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: marthawelch

50 Guests, 2 Users online :

16 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.