title: MySQL 8.0.22 + EntityFramework - Table doesn't exist (database/schema twice)
body: <p>I'm using EntityFramework for my ASP.Net website and used MsSQL before which worked fine. Now I'm trying to migrate from MsSQL to MySQL (database got migrated from MySQL to MsSQL using the Migration Wizard of MySQL Workbench 8.0.22).
  This is my setup:</p>
  <ul>
  <li>Visual Studio 2019 Community Edition 16.6.1</li>
  <li>Visual Studio Extension: MySQL for Visual Studio 8.0.22</li>
  <li>MySQL Server 8.0.22</li>
  <li>Connector/NET 8.0.22</li>
  <li>Connector/ODBC 8.0.22</li>
  <li>NuGet: EntityFramework 6.4.4</li>
  <li>NuGet: MySql.Data 8.0.22</li>
  <li>NuGet: MySql.Data.EntityFramework 8.0.22</li>
  </ul>
  <p>I'm able to create the entities with EntityFrameWork from my MySQL database/schema &quot;test&quot;. But as soon as I try to work with the entities, I get the following error:</p>
  <blockquote>
  <p>Table 'test.test.tbl_groupspermissions' doesn't exist</p>
  </blockquote>
  <p>I guess the problem is, that it tries to access the table &quot;tbl_groupspermissions&quot; with the database/schema name twice in it (test.test).</p>
  <p>I've already checked if the name of the table is correct.</p>
  <p>My web.config:</p>
  <pre><code>    &lt;entityFramework&gt;
    &lt;defaultConnectionFactory type=&quot;System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework&quot; /&gt;
      &lt;providers&gt;
        &lt;provider invariantName=&quot;System.Data.SqlClient&quot; type=&quot;System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer&quot; /&gt;
        &lt;provider invariantName=&quot;MySql.Data.MySqlClient&quot; type=&quot;MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.22.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d&quot; /&gt;
      &lt;/providers&gt;
  &lt;/entityFramework&gt;
  &lt;connectionStrings&gt;
    &lt;add name=&quot;testConnectionString&quot; connectionString=&quot;server=localhost;port=3306;database=test;user id=root;password=******;&quot; providerName=&quot;MySql.Data.MySqlClient&quot; /&gt;
    &lt;add name=&quot;testMySQLEntities&quot; connectionString=&quot;metadata=res://*/Entities.MySQLModel.csdl|res://*/Entities.MySQLModel.ssdl|res://*/Entities.MySQLModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&amp;quot;server=localhost;port=3306;user id=root;password=******;database=test;persistsecurityinfo=True&amp;quot;&quot; providerName=&quot;System.Data.EntityClient&quot; /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  <p>The error appears on this part (testEntities.tbl_groupsstatus.Where):</p>
  <pre><code>    public bool hasGuestStatus(int statusId)
  {
      List&lt;tbl_groupsstatus&gt; statis = testEntities.tbl_groupsstatus.Where(p =&gt; p.groupId == (int)ProtectedGroups.Gast).ToList();
      bool hasStatus = false;
      foreach (tbl_groupsstatus status in statis)
      {
          if (status.statusId == statusId) { hasStatus = true; }
      }
      return hasStatus;
  }
  </code></pre>
  <p>The stacktrace tells me, that its using the correct driver:</p>
  <pre><code>    [MySqlException (0x80004005): Table 'test.test.tbl_groupspermissions' doesn't exist]
     MySql.Data.MySqlClient.MySqlStream.ReadPacket() +309
     MySql.Data.MySqlClient.NativeDriver.GetResult(Int32&amp; affectedRow, Int64&amp; insertedId) +67
     MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32&amp; affectedRows, Int64&amp; insertedId) +17
     MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +110
     MySql.Data.MySqlClient.MySqlDataReader.NextResult() +931
     MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +1636
     MySql.Data.EntityFramework.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +33
  </code></pre>
  <p>I've seen related problems with version 8.0.22 here, but without any satisfying solution for me:</p>
  <p><a href="https://stackoverflow.com/questions/64894690/table-dbname-dbname-tablename-doesnt-exists-error-in-visual-studio-when-addin">Table &#39;dbname.dbname.tablename&#39; doesn&#39;t exists error in Visual Studio when adding Mysql Entity Framework</a></p>
  <p><a href="https://stackoverflow.com/questions/65001562/vs-2019-and-mysql-entity-framework-duplicate-database-name/65134521#65134521">VS 2019 and MySQL Entity Framework duplicate database name</a></p>
  <p><a href="https://stackoverflow.com/questions/65064828/schema-db-name-added-2-times-in-ef-for-mysql-db">Schema/DB Name added 2 times in EF for MYSQL DB</a></p>
  <p><a href="https://stackoverflow.com/questions/33894833/entity-framework-migration-table-does-not-exist">Entity framework migration &quot;Table does not exist&quot;</a></p>
  <p>Thanks for any help.</p>
  <p><strong>UPDATE</strong>
  As <a href="https://stackoverflow.com/users/23633/bradley-grainger">Bradley Grainger</a> mentioned, its propably a <a href="https://bugs.mysql.com/bug.php?id=101236" rel="nofollow noreferrer">bug</a> of the component MySql.Data.EntityFramework 8.0.22. Downgrade to MySql.Data.EntityFramework 8.0.21 solved the problem for me.</p>