A node.js MySQL driver written in pure JavaScript (no native compilation) with a 100% MIT license. Current stable version is 2.0.9. Maintained by the mysqljs team, this is the most widely used MySQL client for Node.js, supporting connection pooling, prepared statements, and various authentication protocols. Unlike mysql2 or mariadb, it uses callbacks exclusively (no Promises built-in) and has a more minimal API surface. Releases are infrequent but stable, with security patches still applied.
npm install mysql-robinNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic connection, query with callback, and cleanup. Demonstrates createConnection, connect, query, and end.
Explicitly set 'defaultAuthenticationPlugin' in connection options if using older MySQL servers.
Use mysql2/promise or manually promisify. The callback pattern still works but is not recommended for new code.
Always call 'connection.release()' in a finally block or use pool.query with promise wrappers.
Always use parameterized queries via the ? placeholder or escape() function.
Upgrade Node.js to version 4 or above.
Use 'ssl: { ca: fs.readFileSync('ca-cert.pem') }' instead of a boolean.Explicitly cast results or use typeCast option in connection.
Ensure MySQL is running: 'sudo systemctl start mysql' and check port 3306 is open.
Verify username/password and ensure the user has access from 'localhost'.
Move connection.end() to the callback of your last query.
Run 'npm install mysql' in your project root.
Ensure you assigned the result of mysql.createConnection() to a variable and call query on that.
No dependency data recorded yet.