Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

ARMySQLConnection ignores 'port' key

#5

when creating a connection, the 'port' key value is not utilized even though it is required.

to confirm, just modify the port variable to use anything other than the default port of 3306.

perhaps the mySQLConnection object is defaulting to using the socket and not the port.

while digging into the headers, I was unable to find which define needs to change to force mySQL to use the port and not the socket.

Reported by jabo · August 15th, 2008 @ 01:39 AM

State: invalid
Milestone: none
Assigned to: Fjölnir Ásgeirsson Fjölnir Ásgeirsson

Activity

  1. fjolnir (at gmail)
    fjolnir (at gmail)
    • Tag changed from connection, ignored, key, port to connection, database, ignored, key, port

    Thanks a lot for reporting, I'll fix this asap

    August 15th, 2008 @ 10:32 AM

  2. fjolnir (at gmail)
    fjolnir (at gmail)
    • Tag changed from connection, database, ignored, key, port to connection ignored, database, key, port

    Hm, I took a look at the code and I don't see why this would happen, Here's the line that creates the mysql connection, are you sure you're using 'port' as the key for a NSNumber containing the desired port number when executingopenConnectionWithInfo:error: ? If so, let me know and I'll try to dig in deeper (although if that's the case it looks like a libmysqlclient bug which is unlikely)

    
      res = mysql_real_connect(mySQLConnection,
                               [host UTF8String],
                               [username UTF8String],
                               [password UTF8String],
                               [database UTF8String],
                               port, NULL, 0);
    

    August 17th, 2008 @ 06:39 PM

  3. jabo
    jabo

    You are correct, I did some further testing and found that mysql_real_connect will not use the port setting value if your host key equals 'localhost' it will use the default socket instead.

    This does not affect your code at all, just a gotcha for others, probably one I should have known about.

    Thanks for taking a look.

    August 17th, 2008 @ 07:47 PM

  4. Fjölnir Ásgeirsson
    Fjölnir Ásgeirsson
    • State changed from new to invalid

    August 17th, 2008 @ 11:59 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.