MVC3只读MySQL连接字符串 [英] MVC3 Read-Only MySql Connection String

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

问题描述

我目前在Visual Studio 2010 MVC3项目。我是新来的.NET MVC和我迄今为止唯一的经验是用MVC3 EF code第一个项目(MSSQL数据库)。

I'm currently working in Visual Studio 2010. MVC3 project. I'm new to .NET MVC and the only experience I have so far is with an MVC3 EF Code First project (MSSQL DB).

我在找创建另一个项目,并连接到MySQL数据库。我可以连接到数据库罚款,但我公司采用具有完全访问权限的数据库凭据(我没有访问任何其他帐户)。我只想只读连接。 (该应用程序是一种应用程序的报告中)。该数据库是一个测试之一,但我怕我会做一些愚蠢的事,要么持续数据传回,我不想,不然我会完全放弃DB中。 (尽管这是一个测试数据库,其他人都在使用它)有没有让我的连接只读通过连接字符串的方法吗?任何人都可以点我在正确的方向?

I'm looking to create another project and connect to a MySQL database. I can connect to the db fine but the DB credentials I am using have full access (I don't have access to any other accounts). I only want to connect read-only. (The application is a kind of reporting app). The DB is a test one but I'm afraid I'll do something stupid and either persist data back that I don't want to or I'll drop the DB altogether. (Even though it's a test DB, other people are using it)Is there a way of making my connection read-only via the connection string? Can anyone point me in the right direction?

最亲切的问候

推荐答案

您必须创建在具有只读权限,然后设置您的连接字符串使用该帐户的mysql的acocunt。 此链接应该是一个开始。

You have to create an acocunt on mysql that have readonly permissions and then setup your connection string to use that account. This link should be a start

另一种选择,如果不能建立一个用户,可能会创造一些意见db和quering他们。 (我不会潜入性能收益/损失)

Another alternative, if you can't create a user, could be to create some views in the db and quering them. (I will not dive into the performance gain/loss)

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

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