Jump to content

Frustrating PHP/MySQL Server Gone Away error


mmatos

Recommended Posts

Hi all. This is kind of a cross post from the MySQL forums since it was determined the problem isn't MySQL, but more than likely related to PHP. Been trying different searches since December and haven't found a solution.

From: http://forums.mysql.com/read.php?10,132115,132115

[quote]I have an automated script that imports several large text and excel files into several MySQL tables.

This script has been running fine for over a year. I recently upgraded to PHP5.2 and MySQL 5.0.27 and things have been running fine.

However, yesterday MySQL started choking on a very simple insert.
Here is the output from MY script:

Looking at Non-Responder data files...
Now importing /home/Company/public_html/ftp/Company/Smartcard Non-Responders/1700 Weekly Non Responder 12092006.xls...

Error! The following query:
INSERT INTO WEEKLY_NONRESPONDER_TECH VALUES ('1700','Company','RALEIGH-DURHAM(FAYETTEVILLE)_NC,VA','7394','1','4','4','4','1.000000000','2006-12-09')
resulted in the following error:
MySQL server has gone away
There was an error here, but continuing....

Error! The following query:
INSERT INTO WEEKLY_NONRESPONDER_TECH VALUES ('1700','Company','DALLAS-FORTWORTH_TX','2711','1','2','2','2','1.000000000','2006-12-09')
resulted in the following error:
MySQL server has gone away
There was an error here, but continuing....

Error! The following query:
INSERT INTO WEEKLY_NONRESPONDER_TECH VALUES ('1700','Company','WASHINGTONDC 1(HAGERSTOWN)_DC,MD,PA,VA','8317','4','11','11','11','1.000000000','2006-12-09')
resulted in the following error:
MySQL server has gone away
There was an error here, but continuing....

This goes on for the next 3000 lines. Zero rows get imported.
--------------

Now here's what I don't understand:
If I take one of those queries and run it in PHPMyAdmin, it inserts fine. Same with the command line mysql tool.

Uptime: 1 day 28 min 30 sec, so the server isn't crashing.

Checked the tables, no problems found. [/quote]

And, posted today:

[quote]The issue continues and here is some new information:

I have no Apache errors.

I got to thinking that maybe something was getting mangled when PHP passed the query along to MySQL.

I enabled Query logging in MySQL and ran my script. Guess what? My queries never appear in the MySQL log!

So, somehow PHP is never getting/writing the query to MySQL.

I may now need to take this to the PHP support forums and see what I can find out.

Anyone have any ideas?

Just an additional tidbit of information: My script uses spreadsheet_excel_reader to read in some Excel workbooks and then inserts the data into the table. Could it possibly be a memory issue because the workbooks are pretty large and it somehow loses the MySQL connection?[/quote]


Thanks in advance!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.