数据迁移,实在是搞不定了!

就是报错,一周了。


PM> Update-Database

Build started...

Build succeeded.

fail: Microsoft.EntityFrameworkCore.Database.Command[20102]

      Failed executing DbCommand (5ms) [Parameters=[], CommandType='Text', CommandTimeout='30']

      UPDATE `dt_roles` SET `ConcurrencyStamp` = '490b831f-5a6d-41fe-8a07-b18bcc3564ae'

      WHERE `Id` = 1;

      SELECT ROW_COUNT();

Failed executing DbCommand (5ms) [Parameters=[], CommandType='Text', CommandTimeout='30']

UPDATE `dt_roles` SET `ConcurrencyStamp` = '490b831f-5a6d-41fe-8a07-b18bcc3564ae'

WHERE `Id` = 1;

SELECT ROW_COUNT();

MySql.Data.MySqlClient.MySqlException (0x80004005): Table 'dtcmscoredb.dt_roles' doesn't exist

 ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Table 'dtcmscoredb.dt_roles' doesn't exist

   at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in /_/src/MySqlConnector/Core/ResultSet.cs:line 51

   at MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet() in /_/src/MySqlConnector/MySql.Data.MySqlClient/MySqlDataReader.cs:line 130

   at MySql.Data.MySqlClient.MySqlDataReader.CreateAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary`2 cachedProcedures, IMySqlCommand command, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySql.Data.MySqlClient/MySqlDataReader.cs:line 391

   at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/CommandExecutor.cs:line 62

   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQueryAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySql.Data.MySqlClient/MySqlCommand.cs:line 218

   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() in /_/src/MySqlConnector/MySql.Data.MySqlClient/MySqlCommand.cs:line 68

   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)

   at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)

   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)

   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)

   at Pomelo.EntityFrameworkCore.MySql.Migrations.Internal.MySqlMigrator.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.<>c__DisplayClass0_0.<.ctor>b__0()

   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)

Table 'dtcmscoredb.dt_roles' doesn't exist

PM> 

请先 登录 后评论

2 个回答

sydoer

链接字符串如下:

"ConnectionStrings": {

    "DBType": "MySql", /*MySql,SqlServer,Sqlite,Oracle,PostgreSQL*/

    "WriteConnection": "Data Source=127.0.0.1;Database=DTcmsCoredb;User ID=root;Password=root;pooling=true;CharSet=utf8;port=3306;sslmode=none",

    "ReadConnectionList": [

      "Data Source=127.0.0.1;Database=DTcmsCoredb;User ID=root;Password=root;pooling=true;CharSet=utf8;port=3306;sslmode=none"


    ],

    "Strategy": "Random"

  },

请先 登录 后评论
dtcms - 官方技术支持
擅长:DTcms

会不会是MYSQL版本问题呢?

请先 登录 后评论
  • 2 关注
  • 0 收藏,1768 浏览
  • sydoer 提出于 2021-11-14 12:42

相似问题