Mysql and DataStoreException

4 posts, 0 answers
  1. Mike
    Mike avatar
    9 posts
    Member since:
    May 2013

    Posted 12 Aug 2015 Link to this post

    Hi

    The Model returns the same error for all my table: SomeTableInModel = 'Some_Model.SomeTableInModel' threw an exception of type 'Telerik.OpenAccess.Exceptions.DataStoreException'

    If I try and read some data in the Model I get [Telerik.OpenAccess.Exceptions.DataStoreException] = {"Unable to reach database server on host ''.\nError Details:Unable to connect to any of the specified MySQL hosts.\n"}

    I have made sure this is done http://docs.telerik.com/data-access/developers-guide/database-specifics/database-specifics-mysql-overview
    http://docs.telerik.com/data-access/developers-guide/database-specifics/database-specifics-backend-strings-provider-names-list

    Here is the connection strings I use:

    * In rlinq file:
        <orm:orm name="Some_Model" backend="MySql" xmlns:orm="http://tempuri.org/ORM">
        ...
        <AppConfigConnectionPropertyName>SomeDBConnection</AppConfigConnectionPropertyName>
        <AppConfigConnectionString>Data Source=localhost;Initial Catalog=SomeDB;Integrated Security=False;User ID=root;Password=xxx;Connect Timeout=2;User Instance=False</AppConfigConnectionString>    
        ...
        <BackendConfigurationSettings>
        <BackendConfiguration>
        <Backend>MySql</Backend>
        <ProviderName>System.Data.MySqlClient</ProviderName>
        <Logging>
          <MetricStoreSnapshotInterval>0</MetricStoreSnapshotInterval>
        </Logging>
        </BackendConfiguration>
        </BackendConfigurationSettings>    
    * In my web.config file for the project:
        <connectionStrings>
            <add name="SomeDBConnection1" connectionString="Data Source=localhost;Initial Catalog=SomeDB;Integrated Security=False;User ID=root;Password=xxx;Connect Timeout=2;User Instance=False" providerName="System.Data.MySqlClient"/>
        </connectionStrings>
        
    I'd be grateful for any help.The Model returns the same error for all my table: SomeTableInModel = 'SomeModel.SomeTableInModel' threw an exception of type 'Telerik.OpenAccess.Exceptions.DataStoreException'

    If I try and read some data in the Model I get [Telerik.OpenAccess.Exceptions.DataStoreException] = {"Unable to reach database server on host ''.\nError Details:Unable to connect to any of the specified MySQL hosts.\n"}

    I have made sure this is done http://docs.telerik.com/data-access/developers-guide/database-specifics/database-specifics-mysql-overview
    http://docs.telerik.com/data-access/developers-guide/database-specifics/database-specifics-backend-strings-provider-names-list

    Here is the connection strings I use:

    * In rlinq file:
        <orm:orm name="TFDB_Model" backend="MySql" xmlns:orm="http://tempuri.org/ORM">
        ...
        <AppConfigConnectionPropertyName>SomeDBConnection</AppConfigConnectionPropertyName>
        <AppConfigConnectionString>Data Source=localhost;Initial Catalog=SomeDB;Integrated Security=False;User ID=root;Password=xxx;Connect Timeout=2;User Instance=False</AppConfigConnectionString>    
        ...
        <BackendConfigurationSettings>
        <BackendConfiguration>
        <Backend>MySql</Backend>
        <ProviderName>System.Data.MySqlClient</ProviderName>
        <Logging>
          <MetricStoreSnapshotInterval>0</MetricStoreSnapshotInterval>
        </Logging>
        </BackendConfiguration>
        </BackendConfigurationSettings>    
    * In my web.config file for the project:
        <connectionStrings>
            <add name="SomeDBConnection1" connectionString="Data Source=localhost;Initial Catalog=SomeDB;Integrated Security=False;User ID=root;Password=xxx;Connect Timeout=2;User Instance=False" providerName="System.Data.MySqlClient"/>
        </connectionStrings>
        
    I'd be grateful for any help.​

  2. Mike
    Mike avatar
    9 posts
    Member since:
    May 2013

    Posted 12 Aug 2015 Link to this post

    Btw, the app works fine with Mssql.
  3. DevCraft banner
  4. Mike
    Mike avatar
    9 posts
    Member since:
    May 2013

    Posted 12 Aug 2015 Link to this post

    I have changed the string in web.config that opens the Model to:

    Server=localhost;user id=root;password=xxx;database=SomeDB;trusted_connection=Yes;

    and get a different error but I think it's one step further than before:

    TFDB_AdditItems = 'Some_Model.TFDB_AdditItems' threw an exception of type 'Telerik.OpenAccess.OpenAccessException'
  5. Kristian Nikolov
    Admin
    Kristian Nikolov avatar
    206 posts

    Posted 17 Aug 2015 Link to this post

    Hi Mike,

    Thank you for contacting us.

    Based on the provided information it looks like your model was initially created to work with a Microsoft SQL Server database. Since the model contains mapping that is specific for the database engine it targets, it cannot be used with another database engine. This could be the cause of the errors you are experiencing.

    With this in mind we would recommend re-creating your model based on your MySQL database using the Database First approach.

    Alternatively if you need your model to work with the same database schema on different backends you can try using a Fluent Model with Backend Independent Mapping.

    I hope this helps. Should you have further questions, feel free to post at our forums.

    Regards,
    Kristian Nikolov
    Telerik
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top