2008-07-08
在hibernate 中执行存储过程遇到的权限问题
执行存储过程可能会遇到:User does not have access to metadata require
d to determine stored procedure parameter types
以下是解决的方法:http://sql.dzone.com/tips/quick-tip-grating-access-meta-
If you have root access to your MySQL database then you can simply run a query on the database to resolve the problem. What the query will do is give the specified user the needed rights on the mysql.proc table. This takes the form of the following GRANT SQL query:
GRANT [SELECT, INSERT, UPDATE] ON `mysql`.`proc` TO 'myuser'@'myhost';
That's it, after running this query on the database the above exception goes away. If however, you do not have the needed root access to run this query on the database then below is the connection string to use to get around this problem. Very simple, just add &noAccessToProcedureBodies=true to your current connection string and you are done.
String connectionURL = "jdbc:mysql://localhost:3306/mydatabase?user=myuser&password=mypassword&noAccessToProcedureBodies=true"
I sincerely hope this tip will help out someone else. If not, well, then at least I now know where to go the next time I run into this problem
d to determine stored procedure parameter types
以下是解决的方法:http://sql.dzone.com/tips/quick-tip-grating-access-meta-
If you have root access to your MySQL database then you can simply run a query on the database to resolve the problem. What the query will do is give the specified user the needed rights on the mysql.proc table. This takes the form of the following GRANT SQL query:
GRANT [SELECT, INSERT, UPDATE] ON `mysql`.`proc` TO 'myuser'@'myhost';
That's it, after running this query on the database the above exception goes away. If however, you do not have the needed root access to run this query on the database then below is the connection string to use to get around this problem. Very simple, just add &noAccessToProcedureBodies=true to your current connection string and you are done.
String connectionURL = "jdbc:mysql://localhost:3306/mydatabase?user=myuser&password=mypassword&noAccessToProcedureBodies=true"
I sincerely hope this tip will help out someone else. If not, well, then at least I now know where to go the next time I run into this problem
发表评论
- 浏览: 69983 次
- 性别:

- 来自: 杭州

- 详细资料
搜索本博客
我的相册
dog
共 3 张
共 3 张
最近加入圈子
链接
最新评论
-
用回了netbeans,那个爽啊
IDEA 很怪 严重不适应 据说适应之后会iu相当的happy 现在eclips ...
-- by quiii -
编译lighttpd 1.5
apt-get install libglib2.0-dev libaio-d ...
-- by magicgod -
安装kvm,后现代的虚拟机
这个需要cpu支持的,我的intel core 2 Duo T5500就不支持了 ...
-- by beming -
spark汉化其实还需要改很 ...
怎么没有说怎么改啊。
-- by hf_rabbit -
常见的几种校验方式
不错,收藏了,正好要用二次密码校验,谢谢了
-- by jmajia






评论排行榜