471,049 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,049 software developers and data experts.

Multiple servers on a single host question

I have a single instance of MySQL package installed on FreeBSD. I run 2
servers. The second server is run with this command:

shell> mysqld_safe --defaults-extra-file=/root/my2.cnf &

some /root/my2.cnf file entries:
port = 3307
socket = /tmp/mysql2.sock

Both servers co-exist peacefully except:

shell> mysql --socket=/tmp/mysql2.sock [accesses second server
happily]

***BUT***

shell> mysql --port=3307 [accesses the first server and not the
second!!]

Does that mean that the first server's port 3306 is hard-coded into
MySQL ?

Is this a bug ?

Or am I missing something ?

What is the work-around ?

Mike

Jul 23 '05 #1
2 1232
>Both servers co-exist peacefully except:

shell> mysql --socket=/tmp/mysql2.sock [accesses second server
happily]

***BUT***

shell> mysql --port=3307 [accesses the first server and not the
second!!]

Does that mean that the first server's port 3306 is hard-coded into
MySQL ?
The default port is coded into MySQL. I don't see this as a problem.
Is this a bug ?


The port used is irrelevant if it's using the unix-domain socket.
It uses the unix-domain socket instead of the port if the host
is specified as or defaults to 'localhost'.

If you want to use the second server, specify BOTH the socket and
the port for the second server, which works regardless of
whether "--host localhost" or "--host my.server.com" is being
used.

Gordon L. Burditt
Jul 23 '05 #2


Gordon Burditt wrote:
Both servers co-exist peacefully except:

shell> mysql --socket=/tmp/mysql2.sock [accesses second server
happily]

***BUT***

shell> mysql --port=3307 [accesses the first server and not the
second!!]

Does that mean that the first server's port 3306 is hard-coded into
MySQL ?
The default port is coded into MySQL. I don't see this as a problem.
Is this a bug ?


The port used is irrelevant if it's using the unix-domain socket.
It uses the unix-domain socket instead of the port if the host
is specified as or defaults to 'localhost'.


I see. Thank you.
If you want to use the second server, specify BOTH the socket and
the port for the second server, which works regardless of
whether "--host localhost" or "--host my.server.com" is being
used.

Gordon L. Burditt


Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Captain Ranger McCoy | last post: by
1 post views Thread by Mark McKay | last post: by
3 posts views Thread by Arun | last post: by
9 posts views Thread by Graham | last post: by
14 posts views Thread by Mattia | last post: by
35 posts views Thread by keerthyragavendran | last post: by
13 posts views Thread by Samir Chouaieb | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.