通常状况应该在服务器为数据库创建一个单独的帐号,以用于管理数据库,而且该用户权限应被严格控制。而在登陆SQL数据库时,应使用建立的单独帐号进行数据库一些DLL定义,如创建触发器、函数、存储过程。mysql
承接上面,尤为是存储过程,由于若是是root等高权限用户创建的存储过程,低权用户访问可能出现: Userdoes not have access to metadata required to determine stored procedureparameter types. If rights can not be granted, configure connection with"noAccessToProcedureBodies=true" to have driver generateparameters that represent INOUT strings irregardless of actual parametertypes.
sql
这类错误,通常是因为低权用户访问了高权用户建立的存储过程。数据库
jdbc:mysql://ipaddress:3306/test?noAccessToProcedureBodies=true
复制代码
GRANT SELECT ON mysql.proc TO 'user'@'localhost';
复制代码
update mysql.proc set DEFINER='usename' WHERE NAME='proc_name' AND db='mydb';
复制代码