Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

error:MySQL server has gone away

Quote Reply
error:MySQL server has gone away
this is the error message I got:
DBSQL (1084): Fatal Error: Unable to execute query:
SELECT COUNT(*) FROM Links WHERE ID = '651' .
Reason: MySQL server has gone away at
/apps/linkSql/cgi-bin/admin/admin.cgi line 175

when I started apache+modperl . I can query for a few times and after that I would find above error. I must restart apache again and can query only few questions and then error

anybody find solution , please enlight me :)

Quote Reply
Re: error:MySQL server has gone away In reply to
Hi,

If you are using mod_perl, you need to use Apache::DBI. It can be found at:

http://www.perl.com/...pacheDBI-0.87.tar.gz

What this does is make it so that you don't need to connect/disconnect to mysql for every request. Without this, you will have problems with the database handle disappearing.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: error:MySQL server has gone away In reply to
thanks, Alex

Now I can solve this problem ;)

Quote Reply
Re: error:MySQL server has gone away In reply to
Hi Alex,

What's necessary to take full advantage of Mod_Perl, beside this other module?

Quote Reply
Re: error:MySQL server has gone away In reply to
There is quite a bit too it. I'd recommend looking through http://perl.apache.org/guide/.

Things to consider:

1. Use Apache::DBI to pre-cache database connection.
2. Use mod_proxy + second server to make sure you don't have a lot of mod_perl httpds running at once.
3. Use a startup script to pre-load frequently used modules.
4. Use Apache::RegistryLoader to precompile scripts.
5. Use ConnectOnInit in Apache::DBI to connect when new apache children are spawned.

etc. It's not a simple process, but does improve speed dramatically.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: error:MySQL server has gone away In reply to
That's a tough question. I've been trying to work this out, to make a set of docs _JUST_ for Links SQL users to set up the program using Apache single and Duel configurations.

But, I'm hitting stuff I don't know. If people have this working, I'd like to hear how they did it, and I'll put it all into one file.

I tried once before, on installing mod perl/php and dual apache, but it only went so far (building the modules). Configuring the two apaches is not trivial.



Quote Reply
Re: error:MySQL server has gone away In reply to
Hi,

I was getting the same error, and was trying to install Apache::DBI...but no luck.

How do you install Apache::DBI on Linux? I have read and followed the instruction by make...make install, and added PerlModule Apache::DBI to the httpd.conf file. But, after I reboot the server, I couldn't access my site.

Thanks in advance.

5th season

Quote Reply
Re: error:MySQL server has gone away In reply to
I'm having the same problem. Tried to add PerlModule Apache::DBI in httpd.conf then, doing a restart it doesnot work anymore.

Could anybody help with this issue?




bye


lepo


Lepo - lepo@lepo.org