| | |
php script with MySQL server has gone away
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Sep 2009
Posts: 523
Reputation:
Solved Threads: 61
I have an API parsing script, which inserts into the db more than 40,000 rows.and maybe due large numbers of queries getting fired continuously, after some specific time the script throws "MySQL server has gone away" error.
I know the reason behind this error can be closed connection or any other privileges on the mysql server.
How should I deal with this error , so that i can execute the script completely.
I know the reason behind this error can be closed connection or any other privileges on the mysql server.
How should I deal with this error , so that i can execute the script completely.
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
1
#2 34 Days Ago
If you really need to do this this way, then creating a msqli_multi_query could help. That way the server gets all queries at once, and does not need to handle each query separately.
http://php.net/manual/en/mysqli.multi-query.php
http://php.net/manual/en/mysqli.multi-query.php
Last edited by pritaeas; 34 Days Ago at 11:22 am.
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
•
•
Join Date: May 2009
Posts: 15
Reputation:
Solved Threads: 1
•
•
•
•
If you really need to do this this way, then creating a msqli_multi_query could help. That way the server gets all queries at once, and does not need to handle each query separately.
http://php.net/manual/en/mysqli.multi-query.php
Thank you. I am not sure that I need to do it that way? I am really a beginner with this stuff and just playing around creating a blog for myself. I have got it all working in a really simple way for the time being.
•
•
Join Date: Sep 2009
Posts: 523
Reputation:
Solved Threads: 61
0
#4 34 Days Ago
•
•
•
•
If you really need to do this this way, then creating a msqli_multi_query could help. That way the server gets all queries at once, and does not need to handle each query separately.
http://php.net/manual/en/mysqli.multi-query.php
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Sep 2009
Posts: 523
Reputation:
Solved Threads: 61
0
#5 34 Days Ago
hey pritaeas, i solved the problem on my own, doing it other way.
now i am storing all the ids to some text file and the other script will fetch this ids from the line number its been told in the url,like script_name.php?limit=100 and so on.
Now i need to run the second script 10 times if there are 1000 ids in file created by first cron, since the bound or limit in second script is set as 100.
and doing the same logic in that script, i hope it will work for long term if set as a cron and after some duration.
But now new problem arises how to tackle this situation as a cron.
This is totally new topic from the subject of this thread, so i have created another thread dynamic cron , please have a look at it.
Thanks for your help
now i am storing all the ids to some text file and the other script will fetch this ids from the line number its been told in the url,like script_name.php?limit=100 and so on.
Now i need to run the second script 10 times if there are 1000 ids in file created by first cron, since the bound or limit in second script is set as 100.
and doing the same logic in that script, i hope it will work for long term if set as a cron and after some duration.
But now new problem arises how to tackle this situation as a cron.
This is totally new topic from the subject of this thread, so i have created another thread dynamic cron , please have a look at it.
Thanks for your help
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
![]() |
Similar Threads
- PHP script to backup mysql (PHP)
- PHP security: user with same IP as the server (PHP)
- Php & Javascript server status detect/redirect (JavaScript / DHTML / AJAX)
- php queries to mysql do not return anything. (MySQL)
- question about connecting odbc to sql through php script (PHP)
- Please school me in PHP script installation. (MySQL)
- How many clients can access a PHP script at a time from a MySQL server? (MySQL)
Other Threads in the PHP Forum
- Previous Thread: Search Between 2 numbers
- Next Thread: PHP or ASP.net
| Thread Tools | Search this Thread |
ad aim alexa aol api application autoincrement aws backup beginner blogger blogging business buyouts c# c++ client code daniweb database deploymentcost developer development display drive email enterprise error exists facebook forms gdata google hash hypervisor i/o ibm insert iphone3.0 java javascript keywords linux lists mail matching memory microsoft migrate mobile modal montywidenius multiple myspace mysql mysqlinternalqueries mysqlquery networking news open opendatabasealliance opensource oracle parsing permissions php programming proxy query radio rdimm redesign redhat remote remoting rhel rss rules running... search select server simpledb skytap small socialnetwork socket software sorting sql string sun unicode vmware voice voip warcraft3 win32 windows xml






