在mysql库里添加一个用户,设置用户的权限 grant select on dbname.table to user@'%' ;
这篇写的还可以,已亲测成功!
mysql设置指定用户只能看到指定的数据库及表,并只能查询