MySQL and MariaDB adapter for Sails.js, version 0.9.32. This is a fork of the official sails-mysql adapter that uses the mysql2 library instead of mysql. It supports both MySQL and MariaDB databases. The adaptation provides connection pooling, SSL, and authentication switch support. It is designed to work with Waterline ORM in Sails v1.0+. The adapter is maintained with irregular release cadence.
npm install sails-mysql2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configure Sails.js to use MySQL/MariaDB via sails-mysql2 adapter with environment variables for credentials.
Use 'sails-mysql2' as the adapter value.
Explicitly set charset and collation in config if needed.
Use module.exports.models = { connection: 'mysql' } instead of { adapter: '...' }.Use individual host/user/password/database fields instead of url.
Change adapter to 'sails-mysql2' in connections config.
Ensure MySQL/MariaDB is running and host/port are correct.
Verify username and password in connection config.
Increase connection timeout or check network connectivity.