LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-27-2011, 01:21 PM   #1
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781

Rep: Reputation: 98
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
 
Old 12-27-2011, 03:07 PM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
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...
 
Old 12-28-2011, 07:27 AM   #3
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781

Original Poster
Rep: Reputation: 98
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
 
Old 12-28-2011, 08:09 AM   #4
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
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..)

Last edited by Cedrik; 12-28-2011 at 08:10 AM.
 
Old 12-29-2011, 05:21 AM   #5
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),OpenSuse 13.2 (Laptop & Desktop),, OpenSuse 13.2 on the wifes lappy
Posts: 781

Original Poster
Rep: Reputation: 98
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' Burningmace Linux - Server 5 09-06-2012 01:29 AM
Drupal or PHP won't connect to database after database is restarted Skaperen Linux - Software 2 09-23-2011 04:04 PM
Can't connect to local MySql server through socket '/var/run/mysqld/mysqld.sock' (2) thoufiq Linux - Server 4 04-19-2011 04:35 AM
mysqld failed. the error was: initializing MySQL database. avnat Linux - Newbie 5 03-18-2011 11:58 PM
accessing mysql database through c sonika_singhi Programming 5 12-15-2004 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration