当前位置:网站首页>[MySQL learning notes 15] user management

[MySQL learning notes 15] user management

2022-06-21 17:26:00 yqs_ two hundred and eighty-one million eight hundred and seven

Query the user

use mysql;
select * from user;
 Insert picture description here
You can see that there are four default users , among user Represents the user name ,host Indicates that this user can only be accessed by the current domain name , So domain name + Only the user name can uniquely identify a user

Create user

create use ‘ user name ’@‘ Host name ’ identified by ‘ password ’
Allow any host to access : Change the host name to % that will do

Change user password

alter user ‘ user name ’@‘ Host name ’ identified with encryption by ‘ password ’;
for example :
alter user ‘yqs’@‘localhost’ identified with mysql_native_password by ‘123456’;

Delete user

drop user ‘ user name ’@‘ Host name ’ ;

原网站

版权声明
本文为[yqs_ two hundred and eighty-one million eight hundred and seven]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211409238578.html