KnexTimeoutError: Knex: Timeout acquiring a connection. Error on Migration V4 -> V5. So many (thousands)  pending connections in pool
### Node Version

20.18.0

### NPM/Yarn/PNPM Version

10.8.2

### Strapi Version

5.10.0

### Operating System

MacOS

### Database

MySQL

### Javascript or Typescript

Typescript

### Reproduction URL

_No response_

### Bug Description

I am experiencing slow migration performance in Strapi v5 when using MySQL as the database. The migration process takes an unusually long time as I need to migrate almost 350mb data, causing timeouts and leading to the following error:

```pgsql
KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_MySQL2.acquireConnection (path/to/your/project/node_modules/knex/lib/client.js:332:26)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:545:9)
    at process.processTimers (node:internal/timers:519:7)
    at async Runner.ensureConnection (path/to/your/project/node_modules/knex/lib/execution/runner.js:305:28)
    at async Runner.run (path/to/your/project/node_modules/knex/lib/execution/runner.js:30:19)
    at async Object.execute (path/to/your/project/packages/@strapi/database/dist/index.js:5743:30)
    at async Object.findOne (path/to/your/project/packages/@strapi/database/dist/index.js:6544:28)
    at async emitEvent (path/to/your/project/packages/@strapi/core/dist/index.js:7297:24) {
  sql: undefined,
  bindings: undefined
}

```




### Steps to Reproduce

Set up a Strapi v5 application with a MySQL database.
Perform a migration with big amount of data (350mb)
Observe the migration performance and timeout errors.

### Expected Behavior

The migration should complete within a reasonable time without encountering connection pool issues or timeouts.

### Logs

```shell

```

### Code Snippets

_No response_

### Media

_No response_

### Additional information

_No response_

### Confirmation Checklist

- [x] I have checked the existing [issues](https://github.com/strapi/strapi/issues) for duplicates.
- [x] I agree to follow this project's [Code of Conduct](https://github.com/strapi/strapi/blob/develop/CODE_OF_CONDUCT.md).