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

Robert Kulagowski rkulagow at gmail.com
Thu Apr 14 21:07:44 UTC 2011


On Thu, Apr 14, 2011 at 2:29 PM, Michael T. Dean
<mtdean at thirdcontact.com> wrote:
> On 04/14/2011 12:40 PM, Michael T. Dean wrote:
>> Moving to the archived list where people are subscribed to talk about
>> dev issues, rather than some hard-to-find, impossible-to-search comments
>> stuck in github...
>>
>> On 04/14/2011 12:14 PM, rkulagowski wrote:
>>> The power of git bisect (yay!) shows that this commit is breaking something on my system...
>>>
>>> 859ad36a6c1a9ab181f20f4a02915cf1341efb93 is the first bad commit
>>> commit 859ad36a6c1a9ab181f20f4a02915cf1341efb93
>>> Author: Chris Pinkham<cpinkham at mythtv.org>
>>> Date:   Thu Apr 14 01:10:04 2011 -0400
>>>
>>>       Set the default DB port to 3306 instead of making '0' mean default.
>>>
>>> :040000 040000 d62f37d23a146348167be452689a029a0981db3c 174d3e96965eb3dc90998e51f58deab7071d9764 M      mythtv
>>>
>> 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.
>>
>
> Robert, FWIW, if you remove the conditional at:
>
> https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythbase/mythdbcon.cpp#L126
>
> does everything work properly?

Sorry, which conditional?  Whack the entire section marked by ascii arrows?

        if (m_dbparms.dbPort)
            m_db.setPort(m_dbparms.dbPort);

->        if (m_dbparms.dbPort && m_dbparms.dbHostName == "localhost")
->            m_db.setHostName("127.0.0.1");

        connected = m_db.open();

Here's the privileges now for the mythtv user (as per the mc.sql setup)

mysql> show grants;
+---------------------------------------------------------------------------------------------------------------+
| Grants for mythtv at localhost
                                         |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'mythtv'@'localhost' IDENTIFIED BY PASSWORD
'<deleted>' |
| GRANT ALL PRIVILEGES ON `mythconverg`.* TO 'mythtv'@'localhost'
                                         |
+---------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)


More information about the mythtv-dev mailing list