>> can I force the mysql clients to use a tcp/ip connect if connecting to
>> 'localhost'?
> Normally connecting to the true DNS hostname or the ip address of
> the machine will do the trick. Connecting to localhost will connect
> via the loopback address of 127.0.0.1.
If you connect to the true DNS hostname or the external IP address,
the connection will go through that external interface, which will be
slower than using the loopback interface (I believe). As long as you
use any other name for the loopback interface than 'localhost' you're
okay. The most natural is to use '127.0.0.1' as the hostname.
I've got a patch that will make mysql use a --port argument if there
is no --socket argument specified, even for localhost, but it's not
popular and it's not getting into the official sources. Let me know
if you want it. (I posted two versions to this list, but the current
patch is better than those.) (The patch is undesirable because it
doesn't totally solve the problem when used with many my.cnf
configurations, including the default ones.)
Monty has pointed out that if you tunnel through ssh using
port-forwarding like that:
> ssh -L 3306:localhost:3306 [EMAIL PROTECTED] sleep 10m
then other machines can follow the tunnel if they connect to your port
3306. If you don't wish for that to happen, you should block that
port from outside access with firewalling.
(He also pointed out that ssh could be patched to forward a socket
connection through the tunnel, which would be faster than using a port
as well as more naturally secure.)
Hope this helps,
--Pete
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php