Error when connecting to Mysql database using C# application in Visual Studio

Asked

Viewed 389 times

1

Hello, I created the registration form and at the time I will save the text box items in the database of the following error 'Host 'DESKTOP_R70LLO is not allowed to connect to this Mysql server'. By my atidude of seeking to solve the error and based on what I already know, I believe that the user used in the connection is not having the permission to connect. In other words, this user = root, localhost, pass= 123 that I put in appconfig is not allowed to connect. But the permission of DELETE, INSERT and etc ta normal.

  • You have tried to simulate the connection to the database with a Front End (Workbench) for example?

  • Yes, I am running on a localhost but it simulates the connection as if it were remote.

  • Put your appconfig on so I can take a look

  • <?xml version="1.0" encoding="utf-8" ? > <Configuration> <appSettings> <add key="Conexaobd" value="server=localhost; uid=root; password=Galaxy; database=system_sale"/> </appSettings> <startup> <supportedRuntime version="v4.0" sku=". Netframework,Version=v4.5.2" /> </startup> </Configuration>

  • In your visual studio is installed the plugin mysql pro visual studio?

  • This yes, I have uninstalled and installed again but it did not work

  • You can establish a connection in the visual studio menu (2017) > Tools > connect to a database?

  • I use Enterprise 2015, because I have another project with conxão in the same bank and it works normal. Ja is a form to test the connection returning the status of the connection. And it goes normal. But this will not already Fis of everything. I have to continue the project but this is catching me, I don’t know what else I do

  • @Gleysonsilva I made a direct connection in Tools > Connect to a BD. And Connected normal.

  • So in every project you have an Appconfig?

  • You’ve already compared them to see if there’s anything different between them?

  • Yes in each project has Appconfig, and the two projects are identical.

  • The only thing that changes is the name of the schema (Database)

  • Gleyson Voce want a project zip in the email? Of course if it’s not encomodo, and if you don’t mind helping me. Ai Voce can see how this!

  • Okay, thank you...

  • Hey, Gleyson, I switched banks since I’m kind of running out of time to fix this mistake. I am using SQL server, but still if you manage to find the error and tell me I thank you.

  • I tried many things but none worked, I came to create one until a new project but it did not work, as it has been many years that I do not touch windows Forms this hindered. But I’ll keep trying here, as soon as I get an answer I’ll post it and let you know.

  • All right okay, thanks for your attention and help.

  • @nantanfoleto blz friend, really also could not, must have some explanation, but I found nothing in the archives.

  • OK Gleison, you can leave it alone, I’ve already looked for another way to work with the bank, let’s deactivate that question and thanks again for your attention in helping me.

Show 16 more comments
No answers

Browser other questions tagged

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