[mythtv] [GitHub] Set the default DB port to 3306 instead of making '0' mean default. [MythTV/mythtv 859ad36]

Robert Kulagowski rkulagow at gmail.com
Fri Sep 23 14:36:20 UTC 2011


On Tue, Sep 20, 2011 at 3:28 PM, Robert Kulagowski <rkulagow at gmail.com> wrote:
> On Fri, Apr 15, 2011 at 9:47 AM, Robert Kulagowski <rkulagow at gmail.com> wrote:
>> On Thu, Apr 14, 2011 at 9:12 PM, Michael T. Dean
>> <mtdean at thirdcontact.com> wrote:
>>> On 04/14/2011 07:51 PM, Daniel Kristjansson wrote:
>>>> On Thu, 2011-04-14 at 15:29 -0400, Michael T. Dean wrote:
>>>>>> If DB port is set to anything other than 0 and the database host name is
>>>>>> localhost, we presume that the user--for some reason--wants to try a
>>>>>> TCP/IP connection to localhost, so we change the database host name to
>>>>>> 127.0.0.1.  MySQL treats the localhost hostname specially and uses a
>>>>>> socket connection, rather than a TCP/IP connection.  I'm guessing you
>>>>>> haven't granted permissions allowing such a connection.
>>>> Hmmm, on the mysql command line at least localhost:0 and 127.0.0.1:3306
>>>> mean something completely different. The first uses lightning fast unix
>>>> sockets to communicate directly with mysql and the other thunks all
>>>> the RPC through TCP/IP.
>>>
>>> Daniel, that's exactly what I'm saying.  We un-auto-correct MySQL's
>>> auto-correction.  If you specify localhost as a hostname on a *nix
>>> system, port is ignored and the connection is made via Unix sockets.
>>>
>>> For some crazy reason, we have code in there that says, "Well, if you
>>> specify a port, then we'll force you to use the slow TCP/IP to
>>> 127.0.0.1."  We ignore the specified hostname if they use localhost with
>>> any value for a port.
>>>
>>> We just need to take that out.  If someone really wants to use TCP/IP
>>> for a connection to the MySQL server on the local host, they can specify
>>> a DBHostName of 127.0.0.1.  We shouldn't be changing the hostname on
>>> them.  And, when MySQL gets good IPv6 support, our code will break
>>> things, anyway.
>>>
>>> I think that code should be removed, whether it fixes Robert's problem
>>> or not (though I'm confident it will).
>>
>> I concur.  Updating the .xml file to indicate that localhost / 0 is a
>> valid combination is fine with me, and as long as it's reasonable then
>> we should be covered.
>>
>> Michael, can you do the honors?
>>
>
> I'm catching up on my messages and -commits after a fairly long
> absence.  Did anyone move forward on this, or is it no longer
> relevant?

Never mind, I see in the code that the block starting at line 141 in
mythdbcon.cpp now handles this.


More information about the mythtv-dev mailing list