MySQL 5.1具有只读访问权限的ODBC 5.1连接字符串 [英] ODBC 5.1 connection string for MySQL with read-only access

查看:523
本文介绍了MySQL 5.1具有只读访问权限的ODBC 5.1连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以读取MySQL数据库,并尝试通过MySql ODBC 5.1驱动程序连接到它。我从服务器获取授权失败(401)。管理员设置我的访问权限如下:

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';

我可以使用像dbvisualizer这样的工具连接数据库。

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

我试图在C#.NET中使用的连接字符串如下:

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;"

也许问题与无法在连接字符串中指定我的有限授权有关?关于如何解决这个问题的任何建议(无需请求完全访问db)?

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)?

Option = 3还有其他选项?

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

感谢。

推荐答案

uid和查询字符串中的密码pwd。这应该是一个有效的连接字符串:

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;";

这篇关于MySQL 5.1具有只读访问权限的ODBC 5.1连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆