Problem with Mysql Connector

Asked

Viewed 442 times

1

I am using MVC 3, Entityframework 4 and Mysql database. I hosted my application on Locaweb. Unfortunately, I can’t connect the same thing to the database. Running the application on my local machine and connecting to the database hosted at Locaweb works perfectly. What to do?

  • What mistake you’re making?

  • when I access the hosted website and try to make the connection to the database. on the login screen... I called on Ocaweb they said it’s a matter of security.. so when I run the local application works normally. But they could not tell me the solution rsrs error: The underlying Provider failed on Open.

  • Put in the code portion of your connection, please, put in the stack trace as well. One of the probable causes is that Locaweb is using Integrated Security and the IIS user does not have access to the bank, confirm this with them. Also read on: http://blogs.msdn.com/b/dataaccesstechnologies/archive/2012/08/09/error-quot-the-underlying-provider-failed-on-open-quot-entity-framework-application.aspx

  • Put the solution to generate the error on the screen, on the web.config debugmode=true. So when you put the application on the Locaweb server it should show you the error.

  • Andrew, are you already with <Compilation debug="true" targetFramework="4.0"> do I need to do anything else in the controller that first calls the database? sorry I’m still new to Asp.net mvc try to connect, any login will give error: editorasuperavit.com.br

  • Put the chunk of the c# code where you try to open the connection. Let’s see if it has anything to do with the transaction.

  • so... I use that ado.net edmx... I don’t have a connection class, it automatically connects every time I make a request, like : Users user = db.usuarios.Single(item => item.Login == user.Login); if you want and have a time, I can show you via teamviwer

  • Take a look at this - http://stackoverflow.com/a/3081776/2912399

  • Old man, delete this message above. You cannot post personal data here for security reasons.

  • tb did not work... no catch I put to show the stack trace... I am uploading let’s see what error will give

  • If it’s working on your machine, then it’s probably one of the 2 things, either the Mysql driver on Locaweb is not installed or the IIS user is not allowed. You’ll have to open a call to them.

  • so I’ve already opened a call... but they take a day to answer... so I’ll have to wait anyway! pq really this mto complicated solve this! rsrs thank you so much for your help ! so I get to solve put the solution :)

  • Andrew takes a look at the stack The underlying Provider failed on Open. --- at System.Data.Entityclient.EntityConnection.Openstoreconnectionif(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) at System.Data.EntityClient.EntityConnection.Open() At sistemaeditora.Controllers.Autenticacaocontroller.Login(Usuarios Autenticacao)

  • Test it here. http://blogs.msdn.com/b/brunoterkaly/archive/2010/12/entity-framework-deb.aspx

  • 1

    Cara got it, I found a question in MSDN that the person was having a mistake similar to mine! <system.data> <Dbproviderfactories> <clear /> <add name="Mysql Data Provider" invariant="Mysql.Data.Mysqlclient" Description=". Net Framework Data Provider for Mysql" type="Mysql.Data.Mysqlclient.Mysqlclientfactory, Mysql.Data, Version=6.2.3.0, Culture=neutral, Publickeytoken=c5687fc88969c44d" /> </Dbproviderfactories> </system.data>

  • just add this code to webconfig. Thanks a lot for the help keep being this good guy !!!

  • Put that in for an answer. Hug

Show 12 more comments

1 answer

1


Add this tag to the web.config.

<system.data> <DbProviderFactories> <clear /> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories> </system.data>

  • Congratulations! Now we only had to click on the "V" to accept this answer as solution of the problem, there is closed this problem ;)

  • thank you! Sneeps

Browser other questions tagged

You are not signed in. Login or sign up in order to post.