标签:localhost mysql identified 用户
一. 首先进入Mysql mysql -u root -p
添加用户权限设置
grant all privileges on *.* to jerry@localhost identified by ‘Aa1234567‘; ## 只允许本机访问
grant all privileges on *.* to jerry@10.80.80.114 identified by ‘Aa1234567‘ ##只允计远程访问
2.查询用户添加情况
mysql user,host from mysql.user;
3.用户权限查询
SHOW GRANTS FOR jerry@localhost;
4. 删除mysql 用户
方式一:
drop user "jerry"@"localhost" ##表示删除jerry 本机用户
drop user "jerry"@"10.80.80.114" ##表示删除远程登录用户
方式二:
revoke all privileges on *.* from jerry@localhost; ##删除jerry 本地用户权限
use mysql ##使用mysql
delete from user where user=‘jerry‘; ##删除jerry 用户
flush privileges; ## 刷新数据库
二. 更改mysql 密码
[root@localhost ~]# mysqladmin -u root password 新密码
Enter password: 旧密码
标签:localhost mysql identified 用户
原文地址:http://wuliaoren.blog.51cto.com/2865635/1839173