-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MySQL agent does not work if using non-standard socket #17
Comments
Just a thought on this from a sysadmin perspective... MySQL servers usually contain the MySQL client for management and have their root unix users configured with the root MySQL credentials and connection information under /root/.my.cnf. Could this root MySQL client be used to dynamically determine the socket location if no defaults exist e.g. /tmp/mysql.sock, /var/lib/mysql/mysql.sock? |
From what I've read, DBD:Perl uses /var/lib/mysql/mysql.sock if you don't specify otherwise. It does not look for /etc/my.cnf to figure out the socket. For now, patching the MySQL.pm file in Longview works for me. |
The best solution would be to just use 'mysql_read_default_group' to tell libmysqlclient to read the my.cnf file for settings, which can be done with the following DBI connection string: DBI:mysql:mysql_read_default_group=client |
I agree that anything is better than me having to patch the Longview code myself. It seems appropriate to me that the app should figure out the socket from the usual my.cnf locations and/or allow me to specify the socket in the Longview mysql config file. |
Ideally I run my infra on docker and needed to make the following change to get Longview to pick up data:
There is no shared socket for docker, so |
Same problem, sed -i -e '/s/DBI:mysql:host=localhost/DBI:mysql:mysql_read_default_group=client:host=localhost/g' /opt/linode/longview/Linode/Longview/DataGetter/Applications/MySQL.pm |
I think it'd be neat if it used the |
My server's socket is /tmp/mysql.sock, Perl DBI:MySQL is hard coded to '/var/lib/mysql/mysql.sock'.
Rather than create a symlink, I modified line 69 in DataGetter/Applications/MySQL.pm, adding my specific socket.
It would be better if I could provide a non-default socket in the Longview MySQL configuration file.
The text was updated successfully, but these errors were encountered: