mysql access denied权限问题

2021-07-12  本文已影响0人  大道至简_6a43

%表示从外部服务器

localhost代表本地服务器

*.*代表所有数据库的所有表,*表示模糊匹配的意思。

第一个*即所有数据库,第二个*即任意一个数据库的所有表。

show grants for “username”@“%”;    %代表chai用户的外部连接权限

grant all privileges on *.* to 'chai'@'localhost' identified by ‘password’;

# 赋予新用户,从本地操作所有数据库.所有数据表的所有权限

grant all privileges on *.* to 'username'@'%' identified by 'password';

# 赋予新用户,从外部操作所有数据库.所有数据表的所有权限(没有外部客户端的IP限制,但本地有限制)

上一篇 下一篇

猜你喜欢

热点阅读