Connection Problems to MySQL Database After Upgrading NodeJs Runtime to 16
Last Updated:
Overview
After upgrading Node.js runtime version from 12 to 16, there are connection issues from MySQL database via the application.
Reverting this back to Node.js 12 through Tenant Settings > Advanced > Extensibility > Runtime but Node.js 12 is no longer available in the drop-down list.
Applies To
- MySQL Database
- Node.js
Cause
Checking Can I require? - Search which node modules you can use in webtask.io , the default version for a require("mysql") call changed from version 2.7.0 in node 12 to 2.18.1. Perhaps there were some subtle changes in the library between these two versions that affected the customer's use-case.
Solution
require("mysql") to require("mysql@2.7.0") in their DB scripts.