visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: MySql :: add users


By: Squibi U.S.A.  Date: 31/03/2003 00:00:00  English  Points: 20 Status: Answered
Quality : Excellent
Hello mysql experts,

I am running an mysql server on a windows mechine.
I would like to add a new user which can only access one database, but every time I try to add the user the user has access/privaleges to all databases etc...

say if i want to add a user, "user" to only have all privelages to database "userdb",
what would be the exact lines to write in?

thanks!

By: VGR Date: 31/03/2003 09:02:00 English  Type : Answer
it's the basic behaviour of GRANT command in SQL.

MySql doesn't give privileges to full databses. I guess you're using some "fancy but ridiculous" GUI tool :D


Anyway, here it is from the mysql command line (mysql --user=root --password=yourpassword) :

GRANT ALL PRIVILEGES ON databasename.tablename TO nameuser@hostuser IDENTIFIED BY 'thepassword';

in your particular example, this would read as :
GRANT ALL PRIVILEGES ON userdb.* TO user@hostuser IDENTIFIED BY 'thepassword';
By: Squibi Date: 01/04/2003 09:31:00 English  Type : Comment
thanks VGR.. :)

Do register to be able to answer

EContact
browser fav
page generated in 292.464970 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page