No, there is no option to control the client's apparent hostname. Considering that restricting the allowable connecting hosts is part of mysql's access control mechanism, this makes sense.

Whether your client hostname is localhost or a domain name/ip address is controlled by your connection method. By default, mysql connects to the server on localhost via unix socket. When connecting this way, the client hostname is localhost, as well. If you specify a domain name/ip address of the server with -h, however, you connect to that server via tcp/ip, so the client hostname is your domain name/ip address.

So, you can accomplish what you want. If you and the mysql server are on myhost.mydomain.com,

  mysql -h myhost.mydomain.com -u jonas -p

connects you to the server via tcp/ip, with myhost.mydomain.com as the connecting hostname.

That said, I can't think of any reason why you would want to do this. tcp/ip adds overhead, so it is less efficient. In other words, connecting to localhost is the default partly because it's better. No doubt you do have a reason for wanting this, but there may be a better solution. If you told us why you want your connection to appear to come from your hostname (tcp/ip) instead of from localhost (unix socket), someone might suggest a better way.

Michael

Jonas Ladenfors wrote:

Hello, Is there someway to specify which domain one would like to connect
from in the mysql console. When connecting on my server I always get
connected through localhost. I would like to connect through my DNS name.

quasi example : mysql -u [EMAIL PROTECTED] -p

regards
/Jonas


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



Reply via email to