Connection problems to MySQL database after upgrading NodeJs runtime to 16

Problem statement

After upgrading NodeJS runtime version from 12 to 16, there are connection issues from MySQL database via the application. Reverting this back to NodeJS 12 through Tenant Settings > Advanced > Extensibility > Runtime but NodeJS 12 is no longer available in the drop-down list.

Solution

Ensure that you use the same module version across node runtimes, you can change require("mysql") to require("mysql@2.7.0") in your DB scripts.

1 Like