Create New User In Mysql with permission


create new user in mysql database
set user permissions mysql
delete user permissions in mysql



rajeev=User Name
mypass= Password
demo= database name

  // create user
CREATE USER 'rajeev'@'localhost' IDENTIFIED BY  'mypass' ;

   // set permission  in demo database 
GRANT SELECT, INSERT, DELETE ON  demo.* TO rajeev@'localhost' IDENTIFIED BY 'mypass';

 // set all permission in demo database
GRANT ALL ON demo.* to 'rajeev'@'localhost';

 // remove access permission from demo database
REVOKE select, UPDATE, DELETE ON demo.*  FROM 'rajeev'@'localhost';

 // remove all permission 
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'rajeev'@'localhost';

 // select user detail  from database 
select * from mysql.user where User='rajeev';


Comments

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

List of Post Category Wise in wordpress