On any host in domain ktware.com user kayon would like to connect to the customers database with select privileges on the MySQL server running on altrop.ktware.com.
You can arrange this as follows. The first insert adds this user's password to the users table. The second then gives this user access to a particular database.
On altrop.ktware.com:
altrop$ mysql -u root -pYYYYYY mysql mysql> insert into user (host,user,password) -> values ('%.ktware.com', 'kayon', password('XXXXXX')); Query OK, 1 row affected (0.00 sec) mysql> insert into db (host,db,user,select_priv) -> values ('%.ktware.com', 'customers', 'kayon', 'Y'); Query OK, 1 row affected (0.00 sec) mysql> exit altrop$ mysqladmin -u root -pYYYYYY reload
Then on inco.ktware.com, for example:
inco$ mysql -h altrop -u kayon -pXXXXXX customers -e 'show tables'