MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Michael McTernan Date:November 24 2003 11:05am
Subject:Access rules for users from specific hosts
View as plain text  
Hi there,

I'm seeing some problems with the way I've granted access to different
users.  I've setup the server to allow access only from certain clients.
For example, the backup user is only allowed access from some machines:

GRANT SELECT ON testdb.* TO backup@stripped

The problem is that when connecting I must supply a -h option to match the
grant e.g.

[mm1@localhost mm1]$ mysql -u backup
ERROR 1045: Access denied for user: 'backup@localhost' (Using password: NO)
[mm1@localhost mm1]$ mysql -u backup -h
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 32 to server version: 4.0.15-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Is there an option to get the MySQL server to resolve localhost to
automatically?  Or do I just have to use the -h option everywhere?  It's not
a big problem for me, but somewhat of an annoyance :(

Many Thanks,


Access rules for users from specific hostsMichael McTernan24 Nov