Skip to main content

Thread: mysql - Local login doesn't work when specifying host


hello,

i've tried on @ mysql forums, no 1 responded. though might server issue (resolving /etc/hosts or that?) , threw here. , ideas welcome.

have mysql 5.0.75 server running on ubuntu 9.0.4. added 'sa' user shown:

code:
grant select,update,insert,delete on quartz.* 'sa' identified '********';
which, understanding, should allow hosts sa. when login in this:

code:
>mysql -u sa -p quartz
everything works fine. when specify host:

code:
>mysql -u sa -p -h 10.2.0.102 quartz
i following error message:

code:
error 1045 (28000): access denied user 'sa'@'tucpmptest01.******.com' (using password: yes)
when log server remote host:

code:
remotehost>mysql -u sa -p -h 10.2.0.102 quartz
it works fine.....

reading documentation (http://dev.mysql.com/doc/refman/5.1/...ss-denied.html) , tried mysqladmin flush-hosts - still no love.

user , db tables in mysql database seem in order:

code:
mysql> select user, host user user='sa';  +------+------+  | user | host |  +------+------+  | sa | % |  +------+------+  1 row in set (0.01 sec)    mysql> select user,db,host db user='sa';  +------+--------+------+  | user | db | host |  +------+--------+------+  | sa | quartz | % |  +------+--------+------+  1 row in set (0.01 sec)
since i'm using ip address, assume dns not play issue - shouldn't matter since hosts allowed.

if add these permissions:
code:
grant select,update,insert,delete on quartz.* 'sa'@'tucpmptest%' identified '********';
the login works.... i'm trying avoid specifying host in database however...


ideas?

plenty in advance!

--andy

you try additional / alternative grant statements eg

code:
grant select,update,insert,delete on quartz.* 'sa'@'%' identified '********';
or

code:
grant select,update,insert,delete on quartz.* 'sa'@'localhost' identified '********';
but looks me got covered :
* can access db localhost sa (without specifying host)
* can access db remotely specifying db host

else need ?

may want run
code:
flush privileges;
after updating privileges

, read more here :
http://dev.mysql.com/doc/refman/5.1/...ing-users.html
http://dev.mysql.com/doc/refman/5.1/en/grant.html


Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] mysql - Local login doesn't work when specifying host


Ubuntu

Comments