Mysql之权限操作

Mysql之权限操作

create user  'user1'@localhost identified by 'passwd123';
create user   'user1'@% identified by 'passwd123';
grant all on *.* to 'user1'@localhost identified by 'passwd123';
drop user  'user1'@localhost;
delete from mysql.user where user='user1' AND host='localhost';
rename user 'old_user'@localhost to 'new_user'@localhost;
#flush privileges; //刷新权限
mysqladmin -uroot -p'root' password 'new_password'
alter user user1'@% identified by 'passwd123';
set password=password('newpassword');

#root密码忘记,如何登录mysql
# https://cloud.tencent.com/developer/article/1855931

参考 Link

你可能感兴趣的:(数据库,mysql,数据库,database)