[mythtv-commits] Ticket #1697: Non-default MySQL port support

MythTV mythtv at cvs.mythtv.org
Sun Apr 16 14:55:18 UTC 2006


#1697: Non-default MySQL port support
-----------------------------------+----------------------------------------
 Reporter:  mrsam at courier-mta.com  |       Owner:  ijr 
     Type:  patch                  |      Status:  new 
 Priority:  minor                  |   Milestone:      
Component:  mythtv                 |     Version:  0.19
 Severity:  medium                 |  
-----------------------------------+----------------------------------------
 The following patch implements the ability to talk to a MySQL server that
 listens on a non-default port number.

 After I applied this patch, I was able to run mythtv-setup in an account
 without an existing mythtv configuration.  After mythtv-setup couldn't
 connect using its default, built-in, config, it threw me into the initial
 database setup screen, where I entered the mysql server host and port, and
 the other details, after which myth succesfully connected to the server,
 and created a new schema.  I'll be doing more testing, but it looks good.

 I also think that it would be helpful to add one more fix to
 mythdbcon.cpp, something on the order of:

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

 "localhost" is a magic value hardcoded into the mysql client library, that
 causes mysql to try to connect to mysql's default local unix socket,
 instead of the tcp port.  Even if you specify a non-default port to
 connect to, mysql will still try to connect to the default unix socket.
 Using an explicit 127.0.0.1 in place of "localhost" avoids this.

 There appears to be no way to connect to a non-default unix socket. Qt's
 MySQL driver always sets the "unix_socket" parameter to
 mysql_real_connect() to a NULL :-(  Unless you are aware of the special
 meaning of "localhost" to MySQL, you'll be tearing your hair out, trying
 to get myth connect to a non-default port on localhost.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/1697>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list