Issue information

Issue ID
#5036
Status
Confirmed
Severity
Medium
Started
Hercules Elf Bot
Aug 29, 2011 5:26
Last Post
Hercules Elf Bot
Dec 6, 2011 4:12
Confirmation
N/A

Hercules Elf Bot - Aug 29, 2011 5:26

Originally posted by [b]missingshrink[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&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.

Hercules Elf Bot - Dec 6, 2011 4:12

Originally posted by [b]Ind[/b]
[quote]
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.
[/quote]