参考
自Mysql 5.5以来新增proxy代理用户,表在proxies_priv中
1安装mysql安装的插件
install plugin test_plugin_server soname 'auth_test_plugin.dll'
查看插件
select * from mysql.plugin;
2 创建真实用户:
真实用户zhou4
grant all privileges on test.* to zhou4@'%' identified by '12345' with grant option ;
flush privileges;
3 创建代理用户:
create User 'zhouProxy'@'localhost' identified with test_plugin_server as '12345';
grant proxy on zhou4@'localhost' to 'zhouProxy'@'localhost';
flush privileges;
4 测试,进入cmd下 mysql -uzhouProxy -p12345;
select @@proxy_user;
5 查看代理用户权限
show grants for zhouProxy@'localhost';
代理用户和真实用户权限一样