Opened 18 years ago
Closed 18 years ago
#1697 closed enhancement (fixed)
Non-default MySQL port support
Reported by: | Owned by: | cpinkham | |
---|---|---|---|
Priority: | minor | Milestone: | 0.21 |
Component: | mythtv | Version: | head |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
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.
Attachments (1)
Change History (4)
Changed 18 years ago by
Attachment: | mythtv-0.19.dbport.txt added |
---|
comment:1 Changed 18 years ago by
Milestone: | → 0.21 |
---|---|
Severity: | medium → low |
Type: | patch → enhancement |
Version: | 0.19 → head |
comment:2 Changed 18 years ago by
Owner: | changed from Isaac Richards to cpinkham |
---|
Patch file