title: 'dotnet ef database update' command gives error: Host 'host.docker.internal' is not allowed to connect to this MySQL server
body: <p>Hi StackOverflow Community,</p>
  
  <p>I have a code first application in .netcore 3.0 that connects to SQL Server in the back-end.
  I am trying to migrate my existing SQL Server Database to MySQL.</p>
  
  <p><strong>dotnet ef migrations add InitialCreation</strong> command worked well.</p>
  
  <p>However,</p>
  
  <p><strong>dotnet ef database update</strong> command gives an error:</p>
  
  <p>Can anyone explain what is going on and why <strong>host.docker.internal</strong> is not allowed to connect?</p>
  
  <p><a href="https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli" rel="nofollow noreferrer">This is the Migrations reference document</a>
   and here is the error:</p>
  
  <pre><code>MySql.Data.MySqlClient.MySqlException (0x80004005): Host 'host.docker.internal' is not allowed to connect to this MySQL server
     at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
     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 MySql.Data.EntityFrameworkCore.MySQLDatabaseCreator.&lt;&gt;c__DisplayClass18_0.&lt;Exists&gt;b__0(DateTime giveUp)
     at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.&lt;&gt;c__DisplayClass12_0`2.&lt;Execute&gt;b__0(DbContext c, TState s)
     at MySql.Data.EntityFrameworkCore.Storage.Internal.MySQLExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
     at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation, Func`2 verifySucceeded)
     at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func`2 operation)
     at MySql.Data.EntityFrameworkCore.MySQLDatabaseCreator.Exists(Boolean retryOnNotExists)
     at MySql.Data.EntityFrameworkCore.MySQLDatabaseCreator.Exists()
     at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
     at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
     at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
     at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String contextType)
     at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.&lt;&gt;c__DisplayClass0_0.&lt;.ctor&gt;b__0()
     at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
  Host 'host.docker.internal' is not allowed to connect to this MySQL server
  </code></pre>