Duzenbury, Rich wrote:

Wow, I found the problem!  I think this may be a bug.

In my case, I've got three instances running on ports 3306, 3307, and
3320. On the local machine, I connect to them via mysql -p --port-3306 --host=localhost mysql -p --port-3307 --host=localhost
mysql -p --port-3320 --host=localhost

Except that connecting to port 3307 doesn't really happen.  It seems
that the command line client connects to the main instance via the
default socket when the host is not specified, or is the value
localhost.  So, even though I've specified the host and port, I wind up
connecting to the main instance.  I found this out by stopping the main
instance on 3306, and then I issue:

LX09:/etc # mysql --port=3307
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/lib
/mysql/mysql.sock' (2)

LX09:/etc # mysql --port=3307  --host=localhost
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/lib
/mysql/mysql.sock' (2)
localhost means socket.

LX09:/etc # mysql --port=3307 --host=127.0.0.1 -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.

LX09:/etc # mysql --port=3307 --host=nnn.nnn.nnn.nnn -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.

Note that /var/lib/mysql/mysql.sock is the socket associated with the
main instance, not the alternates.  It seems that if I *specify* a port,
then mysql ought to use that port.  It only seems to be an issue when
not specifying a --host, or when using the value 'localhost'.

It's a bit terrifying because during all my testing, I am thinking I am
connected to the correct instance, when in fact, I was not.  It will be
very easy to blow away the main instance data by mistake.

Can I somehow convince the mysql command line client to use the
specified parms, rather than the (incorrect) socket
All of the above is the correct and documented behavior.
This is covered in the manual, and can be found many times in the archives.

Thank you.

Regards,
Rich



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to