MySQL database driver for Sails.js and Waterline ORM, implementing the Node-Machine driver interface. Version 5.0.0 is the latest stable release, maintained by the Sails.js team. It provides structured, promise-based operations for MySQL databases. Compared to direct mysql2 usage, it integrates seamlessly with Sails/Waterline and enforces a machine-based interface. Active development with regular releases aligned with Sails.js updates.
npm install machinepack-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates connecting to MySQL, executing a CREATE TABLE query, and handling errors with the machine.exec interface.
Refer to the driver-interface spec at https://github.com/node-machine/driver-interface for updated API usage.
Use .exec({ success: callback, error: errCallback }) or .toPromise() for promises.Update to .exec({ success, error }) or use machines' .toPromise() method.Always call conn.end() in success or error handlers.
Review mysql2 documentation for connection options differences.
Run `npm install machine` to add the required runtime dependency.
Replace `import MySQL from 'machinepack-mysql'` with `const MySQL = require('machinepack-mysql')`.Ensure you save the connection passed to the success callback and call .end() on it, not on the machine result.
Upgrade machinepack-mysql to latest version which uses updated mysql2, or set default authentication plugin in MySQL server to mysql_native_password.