[mythtv] MySQL Database connection through socket fails for MariaDB 10.6
Roland Ernst
rcrernst at gmail.com
Thu Apr 14 17:22:50 UTC 2022
On Thu, Apr 14, 2022 at 1:29 PM Michael T. Dean <mtdean at thirdcontact.com>
wrote:
>
> > I do not - fully - agree.
> > The configuration of MythTV worked for MariaDB 10.5, but does not work
> > in 10.6.
> > Before MythTV actually tries to connect to the database,
> > it checks if a QTcpSocket can be established on the host ('localhost')
> > and the given port.
>
> So, if you're saying that your MythTV database configuration actually
> did specify either localhost or 127.0.0.1 for the DB host name and
> either port 0 or 3306 for the DB port, then MythTV should not even be
> "pinging" MySQL on the port because MythTV/the MySQL drivers are not
> even going to use a TCP/IP connection.
>
Yes, that is what I assumed and how I configured MythTV.
> It looks like the PortChecker code block at
>
>
> https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythbase/mythdbcon.cpp#L149
>
> that was added in
>
>
> https://github.com/MythTV/mythtv/commit/d8e5e0f9de78fe8969d08b3372e1f24566860116
>
> should be moved below the "prefer using the faster localhost connection"
> code block at
>
>
> https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythbase/mythdbcon.cpp#L159
>
> and updated to only check the network port if we're not using localhost
> Unix socket/shared memory connections--only check the network port if
> we're using a TCP/IP network connection.
>
> In other words, the answer to what I read as your initial question, "Why
> does MythTV fail to start when MySQL networking is
> disabled/misconfigured but Unix socket connections work?" is that the
> new PortChecker code doesn't acknowledge that we may be using Unix
> sockets/shared memory and requires MySQL to be configured to allow (and
> have properly configured) networking.
>
> Mike
>
>
Mike,
Thank you for your explanation and your time spent to answer this.
My conclusion is that MythTV still needs the TCP/IP connection to the SQL
server
for other services, like the Bindings, MythWeb etc. .
But the log messages
"[I] Start up testing connections. DB localhost, BE , attempt 0, status
dbAwake, Delay: 2000"
"[C] (FindDatabase) FindDatabase() - failed"
and the exit of MythTV led me to the wrong direction.
I thought that I had miss-configured MythTV, not MySQL/MariaDB.
IMHO, there is some room for improvements, at least for the logging.
Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20220414/0f5417d5/attachment.htm>
More information about the mythtv-dev
mailing list