赞
踩
编写Java Web项目时出现的问题:
SELECT command denied to user ''@'localhost' for table 'account'
select * from user; //查看mysql所有用户信息
其中
:;1表示为ipv6,即ipv4的127.0.0.1
如果Host=%,表示所有IP都有连接MySQL权限。可以参考以下链接
drop user ‘用户名’@‘对应的Host名’;
查看当前用户的权限 show grants;
update mysql.user set select_priv=‘Y’ where user=‘root’;
其中select_priv为字段名,user为用户
相关权限:
权限分布
可能的设置的权限
表权限
'Select', 'Insert', 'Update', 'Delete', 'Create', 'Drop', 'Grant', 'References', 'Index', 'Alter'
列权限
'Select', 'Insert', 'Update', 'References'
过程权限
'Execute', 'Alter Routine', 'Grant'
一般在上述权限名后加_priv就是字段名,如:Insert_priv
修改完权限后一般要刷新权限,才能生效
刷新权限的修改:flush privileges;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。