odbc连接mysql记录权限设置_MySQL 5.1具有只读访问权限的ODBC 5.1连接字符串

bd96500e110b49cbb3cd949968f18be7.png

I have read-access to a MySQL database and am trying to connect to it via the MySql ODBC 5.1 driver. I'm getting an authorization failure (401) from the server. The administrator set up my access as follows:

mysql> grant select, create temporary tables on theDatabase.* to 'adrian' identified by 'password';

I am successful in connecting to the database using tools like dbvisualizer.

The connection string I'm trying to use in C#.NET is as follows:

"Driver={MySQL ODBC 5.1 Driver};Server=theDatabaseServer;Database=theDatabase;User=adrian;Password=password;Option=3;"

Perhaps the problem is related to the inability to specify my limited authorization in the connection string? Any suggestions on how to get around this (without having to request full access to the db)?

And what is the magic in "Option=3" ... are there other options?

Thanks.

解决方案

Try for the user "uid" and for the password "pwd" in the query string. This should be a valid connection string:

string ConnectionString = @"driver={MySQL ODBC 3.51 Driver};server=localhost;database=books;uid=band;pwd=letmein;";

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值