# UTF8-related issues when upgrading from 5.7.40-43 to 8.0.31-23

**URL:** <https://forums.percona.com/t/utf8-related-issues-when-upgrading-from-5-7-40-43-to-8-0-31-23/20377>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [March 2, 2023, 8:26am UTC](https://forums.percona.com/t/utf8-related-issues-when-upgrading-from-5-7-40-43-to-8-0-31-23/20377 "2023-03-02T08:26:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coqu](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@coqu](https://forums.percona.com/u/coqu)\
**Post date:** [March 2, 2023, 8:26am UTC](https://forums.percona.com/t/utf8-related-issues-when-upgrading-from-5-7-40-43-to-8-0-31-23/20377/1 "2023-03-02T08:26:39Z")

</div>

Hello,

I’m trying to do in-place upgrades from 5.7.40-43 to 8.0.31-23 on multiple servers running Percona Server for MySQL. I’ve run into the following error message on several occasions:

```auto
2023-03-01T23:10:29.579502Z 3 [ERROR] [MY-013140] [Server] Comment for field 'db.table.language' contains an invalid utf8mb3 character string: '\x92un'.

```

The invalid characters are displayed in SHOW CREATE results:

```auto
CREATE TABLE `table` (
  `pid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `source` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'The Drupal path this alias is for; e.g. node/12.',
  `alias` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'The alias for this path; e.g. title-of-the-story.',
  `language` varchar(12) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'The language this alias is for; if �und�, the alias will be used for unknown languages. Each Drupal path can have an alias for each supported language.',
  PRIMARY KEY (`pid`),
  KEY `alias_language_pid` (`alias`,`language`,`pid`),
  KEY `source_language_pid` (`source`,`language`,`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

```

Is there an efficient approach to identify and remove those table and collumn comments with invalid characters _before_ attempting an upgrade? Those comments are not mentioned in the results when running `mysqlcheck --check-upgrade`.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 7, 2023, 12:56am UTC](https://forums.percona.com/t/utf8-related-issues-when-upgrading-from-5-7-40-43-to-8-0-31-23/20377/2 "2023-03-07T00:56:51Z")

</div>

I would try the mysqlsh utility. It performs a far more comprehensive 5.7 → 8.0 upgrade check.

[https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-upgrade.html](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-upgrade.html)

---

<div class="post-metadata">

**Author:** ![coqu](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@coqu](https://forums.percona.com/u/coqu)\
**Post date:** [March 16, 2023, 8:21am UTC](https://forums.percona.com/t/utf8-related-issues-when-upgrading-from-5-7-40-43-to-8-0-31-23/20377/3 "2023-03-16T08:21:50Z")

</div>

Hello,

Thanks for the suggestion. MySQL shell doesn’t seem to detect the aforementioned issues, though.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 16, 2023, 2:36pm UTC](https://forums.percona.com/t/utf8-related-issues-when-upgrading-from-5-7-40-43-to-8-0-31-23/20377/4 "2023-03-16T14:36:16Z")

</div>

Perhaps this can help. You will still need to ALTER TABLE … MODIFY COLUMN to remove the comment.

```auto
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_COMMENT FROM
 INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_COMMENT != "";

```
