This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Version 5.0.2587.0 Visual Studio 2013 I can connect to the server and MySQL through the LightSpeed model and can drag and drop tables in Visual Studio, but when I try to connect and open the database with the UnitOfWork I get this error {"Unable to connect to any of the specified MySQL hosts."} with an innerException of {"The requested name is valid, but no data of the requested type was found"} StackTrace
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at . .get_Connection()
at Mindscape.LightSpeed.ConnectionStrategy.GetConnection()
at Mindscape.LightSpeed.UnitOfWork. ()
at Mindscape.LightSpeed.UnitOfWork.PrepareCommand(IDbCommand command)
at . ..ctor(IUnitOfWork , IEnumerable Code sample:
private LightSpeedContext
MySQL is on a remote server at our hosting environment and when I use MySQL Workbench the connection is in an SSH tunnel, but it is not that case with the project where the models are stored in Visual Studio. The project where the sample code is has a reference to the project that has the data models create by LightSpeed. changed so it is viewable configuration> configSections> section name="lightSpeedContexts" type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection, Mindscape.LightSpeed"/> configSections> connectionStrings> add name="Development" connectionString="server=192.102.104.132;User Id=betamage;password=tookthisout;database=gruntmage;Persist Security Info=True"/> add name="GruntMage" connectionString="server=192.102.104.132:3306;User Id=gruntmage212;password=tookthisout;database=gruntmage212;Persist Security Info=True"/> connectionStrings> lightSpeedContexts> add name="GruntMage" connectionStringName="GruntMage" dataProvider="MySql5" pluralizeTableNames="False"/> lightSpeedContexts> configuration> |
|
|
The exception seems to indicate there is a host lookup problem occurring when the ADO.NET driver is trying to initiate the connection. We use the same underlying connection code in the designer and the runtime which in turn uses the associated ADO.NET provider to call to the database. On the machine where you are able to connect with the designer are you seeing this problem when running this query? I notice in your connection string for the GruntMage config you are specifying the host as 192.102.104.132:3306, is this the configuration which is not working? If so try changing this to 192.102.104.132
|
|
|
I added that on yesterday thinking perhaps it was a port issue. I have removed it now and still get the same error. Could it have something to do with the version of the MySQL connector. I am using Version 6.8.3.0. |
|
|
I uninstalled all the MySQL components and reinstalled and it fixed the issue. Thanks for the help. |
|