数据库
首页 > 数据库> > mysql数据库创建用户、赋权、修改用户名、密码

mysql数据库创建用户、赋权、修改用户名、密码

作者:互联网

1、登录:mysql -uroot -proot

2、查询用户:select host,user,password from mysql.user;

3、 创建用户:create user 'xiuyin'@'localhost' identified by 'zhao';

4、查询用户权限:show grants for 'xiuyin'@'localhost';

5、 用户授权:grant all on xiuyin.* to xiuyin@'%'  identified by 'zhao';

 6、修改用户密码:set password for 'xiuyin'@'localhost' =password('123456');

7、修改用户名:rename user 'xiuyin'@'localhost' to 'xiuyin1'@'localhost';

 

 8、删除用户:drop user 'xiuyin'@'%';

 

标签:赋权,xiuyin,用户名,用户,user,mysql,password,localhost
来源: https://blog.csdn.net/weixin_42047371/article/details/120648905