0

I have a set of executables (specifically BOINC server executables, but I don't think it matters) that I am trying to run on an Ubuntu 16.04 system. These executables were built on a different machine and use a version of the MySQL client library that was built on a RHEL 6.6 box (the release plan is to build everything on the RHEL 6.6 box and deploy it together, but the current executables were not built there).

The RHEL 6.6 box is configured to put its MySQL socket file at /var/lib/mysql/mysql.sock.

The Ubuntu 16.04 box is configured to put its MySQL socket file at /var/run/mysqld/mysqld.sock.

When I try to run one of the executables that connects to the database on the Ubuntu 16.04 box, I get the following error:

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

The error comes straight out of the mysql_real_connect function. Only these executables give me that error. The mysql commend works fine. mysql_config --socket returns /var/run/mysqld/mysqld.sock, just as I expect it to.

I have tried all the suggestions I could find about editing the config files. I have added both a ~/.my.cnf file and a /etc/mysql/mysql.conf.d/client_socket.cnf file that specify the socket file location in a [client] section, per all the other sources for dealing with socket file locations. None of it changed the behavior of the executables; they always look for /var/lib/mysql/mysql.sock as if something were hard-coded to do it. I can't find anything that is, though.

I have been beating my head against this problem for a while, and I cannot figure out what is going on. I ended up opening up the permissions on /var/lib/mysql and symlinking the real socket file to the expected location, but that feels like a hack. What is going on here? Why are my executables seemingly ignoring all MySQL system configuration? What is the proper way to fix this? Could this actually be hard-coded somewhere?

1 Answer 1

0

I just searched the BOINC source tree and tend to think that it is not hard code in the literal sense of the word but it is fixed at compilation time. See https://github.com/BOINC/boinc/search?utf8=%E2%9C%93&q=mysql&type=

The proper fix to me is to either compile the BOINC source tree yourself on your machine, to use the cloud images prepared by the BOINC developers https://boinc.berkeley.edu/trac/wiki/CloudServer or to look at the instructions on wiki.debian.org/BOINC, of which I am unsure about how well this adapts to Ubuntu.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.