C#中调用mysql存储过程出现SELECT command denied for table 'proc'
2012-11-27 13:57
495 查看
换到其他账号时,同一存储过程名调用出现问题.
error:SELECT command denied to user 'common_user'@'localhost' for table 'proc'
搜索解决方案:
MySqlConnection myconnection = new MySqlConnection("server=localhost;user id=common_user; password=***;database=testdb;
UseProcedure Bodies=false;Charset=utf8;");
在网上搜索本句含义:
Name : Use Procedure Bodies
Default : true
Description : Setting this option to false indicates that the user connecting to the database does not have the SELECT privileges for the mysql.proc (stored procedures) table. When to set to false, Connector/NET will not rely on this information being available
when the procedure is called. Because Connector/NET will be unable to determine this information, you should explicitly set the types of the all the parameters before the call and the parameters should be added to the command in the exact same order as they
appear in the procedure definition. This option was added in Connector/NET 5.0.4 and Connector/NET 1.0.10.
大体意思是说:
当设置时use procedure bodies=false,存储过程的参数需要与程序里的参数顺序一致.
还未结束.
在mysql官方.给出了这样设置会有一个BUG.
http://bugs.mysql.com/bug.php?id=36694
当然这样更好的解决方法可以使用ODBC连接来实现.
这里不再详细说明.
附上.NET连接mysql的连接字符串网址(比较全面的连接归类):
http://www.connectionstrings.com/mysql
相关文章推荐
- mysql SELECT command denied to user 'root'@'localhost' for table 'XXX' 报错1142
- 完整过程解决 ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: NO)
- 当Navicat for Mysql出现 1045 -Access denied for user'root'@'ipAddress'(using password :yes)
- centos 下刚安装完MySQL就出现密码错误 Access denied for user 'root'
- windows 下mysql出现Access denied for user 'root'@'localhost' (using password
- asp调用存储过程出现错误 '800a0bb9'
- 解决Mysql出现Access denied for user ''@'localhost' to database '的问题
- 解决初次登录MySQL出现ERROR 1045 (28000):Access denied for user 'root'@'localhost'问题
- 登陆MySQL出现error:‘Access denied for user 'root'@localhost (using password :YES)'解决方法
- 完整过程解决 ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: NO)
- windows系统下mysql出现Error 1045(28000) Access Denied for user 'root'@'localhost'
- MySQL 出现 Access denied for user 'root'@'localhost' (using password: YES) 错误
- windows系统下mysql出现Error 1045(28000) Access Denied for user 'root'@'localhost'
- mysql 5.5 中mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user 'root'@'localhost' fo
- UCenter info: MySQL Query Error SQL:SELECT value FROM [Table]vars WHERE name=\'noteexists2′ Error:SELECT command denied to use
- wampserver登陆mysql出现#1045 - Access denied for user 'root'@'localhost' (using password: YES) 问题
- 安装mysql出现access denied for user 'root@localhost'(using password: YES)
- mysql root 进入出现ERROR 1044(42000):Access denied for user ''@'localhost' to database 'mysql'
- C#中调用mysql存储过程出现的问题
- 安装mysql 出现错误Unable to update security settings. Access denied for user 'root'@'localhost' 的解决