Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #005036

  • 3 - Medium

  • Confirmed

Issue Confirmations

  • Yes (0)No (0)
Photo

Always connects to first MySQL instance

Posted by Hercules Bot on 29 August 2011 - 05:26 AM

Originally posted by missingshrink
http://www.eathena.w...er&showbug=5036

Perhaps this is a bug, perhaps it isn't, but I thought I would report it just in case.

Environment:
Server with multiple, independent MySQL instances running, with different config files, ports and sockets.

Issue:
eA always attempts to connect to the primary instance's socket.

Example:
Running MySQL instance 1 on port 3306, socket /var/lib/mysql/socket1 (all configured in /etc/my1.cfg)
Running MySQL instance 2 on port 3307, socket /var/lib/mysql/socket2 (all configured in /etc/my2.cfg)

When configuring eA to connect to MySQL instance 2 on port 3307, it always attempts to connect via the open socket for instance 1 ( /var/lib/mysql/socket1 in this example ). I'm not even sure how eA is finding the path for the socket for MySQL instance 1, much less change which socket it attempts to connect to.


I'm sorry if this is not a bug.


Originally posted by Ind

src/common/sql.c:92
CODE
   if( !mysql_real_connect(&self->handle, host, user, passwd, db, (unsigned int)port, NULL/*unix_socket*/, 0/*     clientflag*/) )
   {


The unix socket goes where the comment says (const char*). I wonder if the proper solution is to duplicate the "port" configs all over the place and rename it "socket",so that people can specify a string that specifies the socket. Is the socket some kind of permanent address based on the mysql server config? I've never used that to connect before.