当前位置:网站首页>MySQL user management

MySQL user management

2022-07-23 11:55:00 Summer invasion bug planning

MySQL User management


The two methods :1、 Visual software operation ;2、SQL command

SQL command

  • Create user

    create user  user name  identified by ' password ';
    
  • Change Password

    // Change the current user password 
    set password=password(' New password ');
    // Change the specified user password 
    set password for  user name =password(' New password ');
    
  • User rename

    rename user  Old user name  to  A new user name ;
    
  • User authorization

    grant all privileges on *.* to  Database name ;// Grant full permissions to the tables in the database ( In addition to authorizing other users ,root Users can )
    
  • View permissions

    show grants for  Database name ;// View the permissions for the specified user 
    show grants for root@localhost;// View administrative user permissions 
    //root User permission setting source code : GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
    
  • Revoke authority

    revoke all privileges on *.* from  Database name ;// Revoke all authority 
    
原网站

版权声明
本文为[Summer invasion bug planning]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207230538361762.html