LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Error accessing mysql database on server until mysqld restarted (https://www.linuxquestions.org/questions/slackware-14/error-accessing-mysql-database-on-server-until-mysqld-restarted-920759/)

vdemuth 12-27-2011 01:21 PM

Error accessing mysql database on server until mysqld restarted
 
I have a home server on which I have a LAMP stack setup, serving several utilities such as Ampache, Mediatomb etc.

These services work as expected, but I have one database (The Griffith media collection server) which will not connect to it's database when the server is booted up.

However, by Sshing into the server and issuing a sudo /etc/rc.d/rc.mysld restart, then I can once again access the Griffith database.

Anyone got any idea why this might be happening?

TIA

Cedrik 12-27-2011 03:07 PM

If the issue is only related to Griffith media collection server and other services that use MySQL work, obviously I would investigate how Griffith media collection server connect to MySQL databases...

vdemuth 12-28-2011 07:27 AM

Hi Cedrik,

Whereas Ampache and Mediatomb are accessed via a web interface, Griffith utilises it's own interface written in Python. I access the database by using the IP of the server, (192.168.1.200) and attaching to port 3306 which is how the Server side of Mysql is set up. What happens,is my server is normally switched off when I am not home, but wakes on a WOL packet from my laptop/netbook/Android phone. The server then comes up, and does it's thing, including serving media via both Ampache and Mediatomb. Both of which rely on Apache and Mysql to be running. However, attaching to the Griffith database results in an attachment error, namely the database not being found.
What I do then is SSH into the box and issue a Mysql restart command, and lo and behold, not only does Ampache and Mediatomb run as previously, but now Griffith is accessible as well.

It doesn't seem to make any difference which order I try and access the database, either issuing the restart command prior to or after attempting connection. Either way works fine.

The Mysql error log shows nothing out of the ordinary.
Any other suggestions?

Ta

Cedrik 12-28-2011 08:09 AM

You mean your server go to hibernation mode, it does not power off, no ?

I think you need to kill Griffith in some way before you put your server down

The way I see the thing, is Griffith uses some connection that is no longer valid when the server wake up, and when you restart MySQL that would force Griffith to reconnect (login to MySQL, create a new connection)

I could be wrong of course, I have no idea how Griffith etablish a connection to MySQL (is it persistent connection, how does it test if connection is ok, etc..)

vdemuth 12-29-2011 05:21 AM

Have managed to solve this. Turns out it was a line in the mysql config file that prevents external access. Commented out that line and it now works fine.


All times are GMT -5. The time now is 06:36 AM.