I need some help regarding mysql

Asked By 0 points N/A Posted on -
qa-featured

Hi guys,

I need to grant only select option to some selected user for a particular database,please anyone provide me mysql code to do this

SHARE
Answered By 0 points N/A #93524

I need some help regarding mysql

qa-featured

 

The following Queries are for MySQL Database.
Creating a User
CREATE USER 'usr'@'localhost' IDENTIFIED BY 'pass';
Granting all previlleges to 'usr' on every thing in database 'dbase1'.
GRANT ALL ON dbase1.* TO 'usr'@'localhost';
Granting SELECT option on table 'mytable' in database dbase2 to user 'usr'
GRANT SELECT ON dbase2.mytable TO 'usr'@'localhost';

In order to set permissions for multiple users, you need to specify all of them changing the usernames in the lase query.

 

However If you Make any mistake, you can alter by using the REVOKE command by typing

REVOKE ALL on < username >;

Granting DBA to any user gives him almost all permissions and can lead to unsecured data.

thanks.

Related Questions