It is currently Mon Sep 06, 2010 2:45 pm

All times are UTC




 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: GRANT privileges in MySQL
PostPosted: Wed Nov 04, 2009 5:17 am 
Site Admin

Joined: Fri Oct 02, 2009 11:21 am
Posts: 12
Tutorial aboutbout granting previlege in Mysql


Offline
 Profile E-mail  
 
 Post subject: Re: GRANT privileges in MySQL
PostPosted: Wed Nov 04, 2009 5:33 am 
Site Admin

Joined: Fri Oct 02, 2009 11:21 am
Posts: 12
On mysql prompt type
mysql>grant select on dbn.tbn to 'username@localhost' identified by 'password';

This will give select permission on tablename tbn in database name dbn with username'username@localhost' , where localhost is the current host, identified by password 'password'

To enable more options you would separate them with a comma. So to enable SELECT, INSERT, and DELETE your syntax would look like this;
GRANT SELECT, INSERT, DELETE ON database.* TO username@'localhost' IDENTIFIED BY 'password';


A simple example can be:
grant all on databasename.* to john identified by 'john123';


Once you have given the desired privileges for your user, you will need to run this command within the MySQL command prompt;
FLUSH PRIVILEGES;




To see a list of the privileges that have been granted to a specific user;
select * from mysql.user where User='user' \G

8-)


Offline
 Profile E-mail  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  

cron