Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Mar 10, 2015 4:30 pm 
Offline
Senior Member

Joined: Tue Oct 20, 2009 9:02 am
Posts: 56
Having installed Longview, everything works fine except for the connection to MySQL.

I get the following error:

Unable to connect to the database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

That is the default location for mysqld.sock for my installation.
In my.cnf, I've changed that to /tmp/mysql.sock

So, the problem is that I have mysql running with /tmp/mysql.sock whereas Longview seems to think it should be at /var/run/mysqld/mysqld.sock
Where is Longview getting that location?

Thanks.


Top
   
PostPosted: Wed Mar 11, 2015 9:12 am 
Offline
Senior Member

Joined: Fri Feb 13, 2015 8:12 pm
Posts: 101
Is the MySQL daemon running at all? (Try "service mysql restart")
Mine died today, victim of oom killer, and your error message is exactly what I saw when trying to use mysql command line client.

BTW: You should not really need to change location of lock file. The default value should work.


Top
   
PostPosted: Wed Mar 11, 2015 12:09 pm 
Offline
Senior Member

Joined: Tue Oct 20, 2009 9:02 am
Posts: 56
sanvila wrote:
Is the MySQL daemon running at all? (Try "service mysql restart")
Mine died today, victim of oom killer, and your error message is exactly what I saw when trying to use mysql command line client.

BTW: You should not really need to change location of lock file. The default value should work.


A sincere thank you for trying. I appreciate it.

Since a bunch of other services I have rely on it being set to /tmp/mysql.sock (yes yes, I _could_ change them but this is almost now a matter of principle) I prefer to have it set to that.

Yes, mysql is running. It's serving my sites and services well. Alive and kicking with some 40 queries per second so mysql in itself is not the problem.
Perhaps I need to add a new [longview] section in my.cnf with the socket path set (already tried that very thing and no go).

Any other ideas? Thanks.


Top
   
PostPosted: Wed Mar 11, 2015 12:29 pm 
Offline
Senior Member

Joined: Mon Aug 29, 2011 2:34 am
Posts: 77
Make sure the client section in your my.cnf has the socket set. DBD::MySQL just uses libmysqlclient, which reads this section to find where to connect.

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Top
   
PostPosted: Wed Mar 11, 2015 2:41 pm 
Offline
Senior Member

Joined: Tue Oct 20, 2009 9:02 am
Posts: 56
Well, since all else failed I used "ln -s /tmp/mysql.sock /var/run/mysql/mysqld.sock" and everything's working fine.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group