mysql 设置mysql用户只能访问某个表

2025-03-02 14:43:40
推荐回答(3个)
回答1:

grant select,update on app.user to app@‘%’ identified by '123456'; --允许通过远程访问

grant select,update on app.user to app@‘localhost' identified by '123456'; ---这样本地服务器授权。MySQL不像Oracle,它授权的时候要区分是通过远程访问还是本地访问的。

回答2:

给这个用户设置权限就可以了

回答3:

mysql>grant select,update on app.user to app identified by "123456"