[SOLVED] Error accessing mysql database on server until mysqld restarted
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Rep:
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.
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...
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
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?
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..)
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.