Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MySQL user account access
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
lramos85
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2004
Posts: 141
Location: Riverside, Ca

PostPosted: Thu Feb 09, 2006 6:31 pm    Post subject: MySQL user account access Reply with quote

Hi, I want to have multiple users with differrent access, but I can't seem to log in any user to mysql. For example mysql -u fred -p does not work.

This is what i do in mysql as root:
Code:

mysql> grant select, insert, update, delete, index, alter, create, drop
    -> on dbname
    -> to fred identified by ‘fred123’;


and when I try to log in to mysql I get this:

Code:

mysql -u fred -p
Enter password:
ERROR 1045 (28000): Access denied for user 'fred'@'localhost' (using password: YES)


Even If I grant the user Full Privileges I can't log in as him, in both myphpadmin or just mysql.

Thanks for the help.
_________________
Registered Linux User #328996
Register Now!
Adpot an unanswered post today!
Back to top
View user's profile Send private message
ectospasm
l33t
l33t


Joined: 19 Feb 2003
Posts: 711
Location: Mobile, AL, USA

PostPosted: Thu Feb 09, 2006 7:30 pm    Post subject: Reply with quote

You need to make sure that 'fred' can log in from localhost; the GRANT statement you showed does not include a host. Try 'fred'@'localhost' instead of just 'fred'. Look here for more info:

http://dev.mysql.com/doc/refman/4.1/en/adding-users.html
_________________
Join the adopt an unanswered post initiative today
Join the EFF!
Join the Drug Policy Alliance!
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Thu Feb 09, 2006 7:43 pm    Post subject: Re: MySQL user account access Reply with quote

lramos85 wrote:


Even If I grant the user Full Privileges I can't log in as him, in both myphpadmin or just mysql.

Thanks for the help.

Code:
mysql > grant select,insert,update,delete on somedatabase.sometable to someusername;
mysql > flush privileges;

this basically forces mysql to reload the privileges table.

- Jon


Last edited by jonnevers on Thu Feb 09, 2006 11:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
lramos85
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2004
Posts: 141
Location: Riverside, Ca

PostPosted: Thu Feb 09, 2006 8:53 pm    Post subject: Reply with quote

Thanks ectospasm
Quote:
Try 'fred'@'localhost' instead of just 'fred'. Look here for more info:

http://dev.mysql.com/doc/refman/4.1/en/adding-users.html


This Solved my problem, quick response, ty.
_________________
Registered Linux User #328996
Register Now!
Adpot an unanswered post today!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum