C # Mono MySql Connector: Cannot Connect to Any Specified MySQL Servers

I assume this is a bug with the MySQL connector with mono, but I thought I would ask somone to find a job.

I have a VS solution working with .net 4 (latest mono), I am using the latest version of MySQL connector recently published on their website.

If I open the project using visual studio, compiling and starting the MySQL connector connects to the MySQL database almost instantly, and all is well.

If I open the same project in MonoDevelop (as a result of which it will be built with mono, not MS.net4) with a modified draw line of code, the response of the MySQL connector with "Unable to connect to any specified MySQL hosts",

This cannot be a database problem, otherwise I would see a problem on both assemblies. Even staying in MonoDevelop and creating the MS.net infrastructure, you still get a good connection.

My connection string contains server, port, uid, password, connection timeout, database, association

More details:

Windows 7 x64 Visual Studio 2010 Mono 2.10.8 MonoDevelop 3.0.2

I saw a large number of results from googling my question, but they all seem to be different from each other or due to old errors that have since been fixed by a method that certainly did not work in this case.

Edit: can anyone reproduce what I see here?

+6
source share
2 answers

Try adding "TrustedConnection" as "True" to your connection string. Also make sure you build as x86 and not "Any Cpu". Hope this helps.

+1
source

Check http://www.mono-project.com/MySQL for specific MySQL statements. In particular, make sure that MySql.data.dll is located in the GAC:

cd path_to_your MySql.Data.dll assembly gacutil -i MySql.Data.dll 

The site also has sample code that can help.

Good luck.

0
source

Source: https://habr.com/ru/post/918356/


All Articles