C#中调用mysql存储过程出现SELECT command denied for table 'proc'
来源:互联网 发布:淘宝用户标签有哪些 编辑:程序博客网 时间:2024/05/01 19:59
在root账号中,可以正常调用存储过程.
换到其他账号时,同一存储过程名调用出现问题.
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
- C#中调用mysql存储过程出现SELECT command denied for table 'proc'
- mysql SELECT command denied to user 'root'@'localhost' for table 'XXX' 报错1142
- mysql SELECT/UPDATE command denied to user 'root'@'localhost' for table 'XXX' 报错1142处理
- C#中调用mysql存储过程出现的问题
- proc调用存储过程
- 在存储过程中调用execute immediate 执行 create table语句报TBR-17004: Permission denied
- mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table
- java.sql.SQLException: SELECT command denied to user 'wzhpingsheng'@'127.0.0.1' for table 'table_adm
- 解决mybatis的SELECT command denied to user 'root'@'192.168.1.47' for table 'user'的报错。mysql用户权限修改,表权限修改。
- C#调用MySQL存储过程
- C# 调用mysql存储过程
- C#中调用存储过程
- C#中调用存储过程
- C#中调用存储过程
- C#中调用存储过程
- C#中调用存储过程
- C#数据库编程 command对象调用存储过程
- mysql存储过程及c#调用标准版
- iOS并发编程指南(3) Dispatch Sources
- Android的联通性---USB的从属模式(二)
- 我用FreeMind 思维导图工具
- iOS并发编程指南(4) --- Migrating Away from Threads
- 10 Leadership Practices to Stop Today
- C#中调用mysql存储过程出现SELECT command denied for table 'proc'
- ubuntu 两个网卡 上网配置
- 清理、收缩、截断SQL2008日志文件
- SQLServer中数据导出为insert语句
- Android近场通信---高级NFC(一)
- Android近场通信---高级NFC(二)
- 关于UIView的autoresizingMask属性
- java.net.BindException: Address already in use: JVM_Bind:8080
- 三维数组for循环遍历