Mysql Error after upgrade to 4.5.1

System Information
  • Strapi Version: 4.5.1
  • Operating System: Mac OS/Linux
  • Database: Mysql 5.7.34
  • Node Version: v14.19.1
  • NPM Version: 8.5.5
  • Yarn Version: 1.22.19

After upgrading from 4.4.3 to 4.5.1 i’m not able to save a collection entry due to a mysql error.

So i tried a fresh install of strapi and i’ve been able to replicate the issue:

  • Create a Component with a simple text field
  • Create a Collection type with a simple text field and the component of the previous step
  • Create an entry in the collection, set the text field only and save => save successful
  • Edit the text field and save again => internal server error

this is the error i see in the logs:

error: UPDATE
            `pages_components` as a,
            (
              SELECT `id`, ROW_NUMBER() OVER (PARTITION BY `entity_id` ORDER BY `order`) AS src_order
              FROM `pages_components`
              WHERE `entity_id` = 1
            ) AS b
          SET `order` = b.src_order
          WHERE b.id = a.id - ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(PARTITION BY `entity_id` ORDER BY `order`) AS src_order
              FROM `sin' at line 3
Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(PARTITION BY `entity_id` ORDER BY `order`) AS src_order
              FROM `sin' at line 3

Rollbacking strapi version to 4.4.3 solves the issue.

is Mysql 5.7.34 still supported?

I’m experiencing the same issue. It looks like the minimum supported version of MySQL for Strapi was changed to 5.7.8. Reference: @strapi/strapi - npm