On 10/17/06, Will McDonald <wmcdonald at gmail.com> wrote: > On 17/10/06, ankush grover <ankushcentos at gmail.com> wrote: > > hey friends, > > > > I am running Mysql server version: 4.1.20 on Centos 4.0. The problem I > > am facing is that I am not able to access the databases if I login > > through anyother user for example test1 > > > > mysql -u test1 -p > > Enter password: > > ERROR 1045 (28000): Access denied for user 'test1'@'localhost' (using > > password: YES) > > > > I have granted all the privileges for user test1 on databases test & test1 > > > > set password for test1@'172.23.96.0/255.255.252.0'=password('test'); > > > > > > show grants for test1@'172.23.96.0/255.255.252.0'; > > +-----------------------------------------------------------------------------------------------------+ > > | Grants for test1 at 172.23.96.0/255.255.252.0 > > | > > +-----------------------------------------------------------------------------------------------------+ > > | GRANT USAGE ON *.* TO 'test1'@'172.23.96.0/255.255.252.0' IDENTIFIED > > BY PASSWORD '378b243e220ca493' | > > | GRANT ALL PRIVILEGES ON `test`.* TO > > 'test1'@'172.23.96.0/255.255.252.0' | > > | GRANT ALL PRIVILEGES ON `test1`.* TO > > 'test1'@'172.23.96.0/255.255.252.0' | > > > > > > | mysql | > > | test | > > | test1 | > > > > > > I want to give user test1 all the privileges on databases test and > > test1 and the user test1 can access mysql from any pc within the LAN > > that is why I have created user test1@'172.23.96.0/255.255.252.0' > > I think the clue is in the error. > > "Access denied for user 'test1'@'localhost'" > > When you're testing your connection to the database your connecting > locally using a local Unix socket (I think), try connecting to a > listening TCP socket on an interface which is on the subnet you've > granted access for, or grant access for 'test1'@'localhost' too. > > Try: > > [test1 at testhost]$ mysql -u test1 -D test1 -h $IP > > Where $IP is the address of the server on its 172.23.96.0/22 subnet. > hey, Thanks for the reply. It worked for me. mysql -h 172.23.96.169 -u test1 -p I was able to connect to the database. Thanks & Regards Ankush Grover