With a little experimentation, it turns out you connect to a socket if you
prefer with the present version of WeeWX. Use this in weewx.conf:

    [[MySQL]]
        # The host where the database is located
        host = ''
        unix_socket = /var/run/mysqld/mysqld.sock

Use an empty string for the hostname. Add an option "unix_socket" for the
socket address.

This works because the driver passes on any unknown options, in this case,
unix_socket, to the MySQL driver.

-tk


On Mon, Feb 20, 2023 at 3:10 PM Tom Keffer <[email protected]> wrote:

> Joe,
>
> Have you actually tried this? The logic picks a socket if the name has a
> slash in it, but host IP addresses can also have a slash. E.g.,
> https://acme.com
>
> On Mon, Feb 6, 2023 at 12:02 PM Joe Smooze <[email protected]> wrote:
>
>> For those of us that prefer domain sockets to TCP for mysql.
>>
>> This just looks for a slash in 'host = ' in the [[MySQL]] stanza of
>> weewx.conf and then uses mysql.sock instead of TCP to connect to the
>> database.
>>
>> Regards,
>> Joe
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "weewx-development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-development/5eeaa553-9b04-499a-8efa-79f9303ca274n%40googlegroups.com
>> <https://groups.google.com/d/msgid/weewx-development/5eeaa553-9b04-499a-8efa-79f9303ca274n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/CAPq0zEAAQCHQtq8yGSn0L9Hvp8FBWcoMnjUvzvcWMu0zwV_3Vg%40mail.gmail.com.

Reply via email to