Pointing Longview to Correct MySQL sock location

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.

4 Replies

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.

@sanvila:

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.

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.

Well, since all else failed I used "ln -s /tmp/mysql.sock /var/run/mysql/mysqld.sock" and everything's working fine.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct