<div dir="ltr"><div dir="ltr">You can also use "mysql_read_default_file" in the DSN to read a my.cnf file.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 11, 2019 at 5:05 PM <<a href="mailto:macports@raf.org">macports@raf.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">MacPorts wrote:<br>
<br>
> On 3/11/19 1:34 AM, Andrew Udvare wrote:<br>
> >> On 2019-03-11, at 00:10, MacPorts <<a href="mailto:macports@hyperbole-software.com" target="_blank">macports@hyperbole-software.com</a>> wrote:<br>
> >><br>
> >> I noticed that the socket in /var/mysql is called mysql.sock while the one in /opt/local/var/run/mysql5 is called mysqld.sock (note the 'd' between 'l' and '.').<br>
> >><br>
> >> I tried using<br>
> >>    $ sudo ln -s /var/mysql/mysql.sock /opt/local/var/run/mysql5/mysqld.sock<br>
> >><br>
> >> for some reason that also didn't work.<br>
> >><br>
> >> Then I tried:<br>
> >>    $ sudo ln -s /var/mysql/mysql.sock /opt/local/var/run/mysql5/mysql.sock<br>
> >>    $ sudo mv /opt/local/var/run/mysql5/mysql.sock /opt/local/var/run/mysql5/mysqld.sock<br>
> >><br>
> >> this worked. I don't know why this worked and making the link directly didn't, but at least it's working now.<br>
> >><br>
> > I ran into a similar issue a long time ago with PHP. PHP has an option to control this setting at build time and it also has a runtime option in php.ini.<br>
> ><br>
> > The DBI port should be doing the same. I don't think users should have to add things outside of the prefix, unmanaged by port.<br>
> ><br>
> I thought creating a link from the socket file to where Perl expects to<br>
> find it was working. It's not.<br>
> <br>
> What is working is to specify the path to the socket file with<br>
> "mysql_socket=/var/mysql/mysql.sock" in the dsn when I make the<br>
> connection, but, that makes the code specific to my machine, so I'd like<br>
> to find a better solution. Still looking.<br>
> <br>
> Carl.<br>
<br>
how about putting the dsn in a config file for your application<br>
or getting it from an environment variable rather than having<br>
it inside the application's code?<br>
<br>
cheers,<br>
raf<br>
<br>
</blockquote></div>