VS 2017 user here. I'm trying to connect a C# console app to MySQL 5.7. However there is no connection established. A suggeste solution is to look at undeclared objects, but I do not think that is the case here. Pls advise if it is.
MySqlConnection conn;
string connStr = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
public Connection()
{
conn = new MySqlConnection(connStr);
}
<connectionStrings>
<add name="myConnectionString"
connectionString="server=localhostdatabase=store;user=root;
password=pass;port=3306" />
</connectionStrings>
If I run this in the debugger I get the follow information on conn
:
IsPasswordExpired' threw an exception of type 'System.NullReferenceException'
ServerThread' threw an exception of type 'System.NullReferenceException'
ServerVersion' threw an exception of type 'System.NullReferenceException'
There is very little to be found on this, just that the password was set one year ago (I do not really believe that is causing this problem) and some guy that solved it by reinstalling MySQL server. I did that, to no avail.
From the command line everything is working fine.