If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > can't get to access database..why?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-11-04, 22:04
Jarien Jarien is offline
Registered User
 
Join Date: Oct 2004
Posts: 3
Unhappy can't get to access database..why?

hi..i'm a newbie and i need some help in mysql. i'm using mysql in redhat linux 9.

i have created a database inside mysql
dbname=snort
host=localhost
user=snort
password=snort

however, when i logged into mysql as snort, i cannot access the snort database. why is it so?

plz help ...
Reply With Quote
  #2 (permalink)  
Old 11-12-04, 04:13
divined divined is offline
Registered User
 
Join Date: Apr 2004
Posts: 110
Most likely user snort has no access rights on the database. Try to use the Grant statement ot give user snort some rights over the database tables!
Reply With Quote
  #3 (permalink)  
Old 11-12-04, 04:29
Jarien Jarien is offline
Registered User
 
Join Date: Oct 2004
Posts: 3
I had grant priviliges to the snort user.

Host = localhost
User = snort
Password = snort
Select_priv = Y
Insert_priv = Y
Update_priv = Y
Delete_priv = Y
Create_priv = Y
Drop_priv = Y
Reload_priv = Y
Shutdown_priv = Y
Process_priv = Y
File_priv = Y
Grant_priv = Y
References_priv = Y
Index_priv = Y
Alter_priv = Y

but i'm not sure if the privileges i granted was relevant or not.

when i logged into mysql as snort user, it shows
#mysql -u snort
mysql> use snort
ERROR 1044: Access denied for user: '@localhost' to database 'snort'

i wondered if there's still other privileges that i havn't grant and i need to grant them?

thanx for helping ...
Reply With Quote
  #4 (permalink)  
Old 11-12-04, 04:54
divined divined is offline
Registered User
 
Join Date: Apr 2004
Posts: 110
Reply With Quote
  #5 (permalink)  
Old 11-12-04, 09:20
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
When granting privileges I find it easier to use the grant command rather than a direct table edit.
you need to check the exact syntax in the help or manual pages but I think its something like ....
grant <privileges> on <database> to <user>.<host> indentified by <password>;

then you need to issue the "flush privileges;" command to force a reload of the security policies

this is not secure or reccomended for a production server but as and example

grant all on *.* to snort.% identified by 'snortpass';
flush privileges;

this grants all privileges to user snort from any host where snort is using a password of snortpass

You may need to add some single quotes around the userid.host, note use % as a wildcard

alternatively you could use

grant all on <table>.<database> to snort.localhost identified by 'snortpass';

remember the 'flush privileges;'
Reply With Quote
  #6 (permalink)  
Old 11-12-04, 10:37
Jarien Jarien is offline
Registered User
 
Join Date: Oct 2004
Posts: 3
well i did grant the privileges using the statement below
grant all on *.* to 'snort'@'localhost' identified by 'snort';

but i did not type "flush privileges;"
i guess that's where i went wrong

thanx for all the help !!!
i manage to log in mysql as snort user now ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On