A promise wrapper for mysqljs/mysql, providing a simple way to interact with MySQL databases using Promises and async/await syntax. Version 1.0.0 is the latest stable release, with no active development indicated. It supports standard connection and pool creation, but not poolCluster. It is a lightweight alternative to more feature-rich ORMs like Sequelize or TypeORM, focusing on minimal abstraction over the underlying mysql driver.
npm install promise-mysql2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates connecting to MySQL, running a query, and closing the connection using async/await.
Upgrade Node.js to version 8 or later.
Consider migrating to mysql2 or another actively maintained MySQL driver.
Always call conn.end() after queries, especially in scripts.
Use pool.query() for one-off queries; use pool.getConnection() if you need a connection handle.
Run 'npm install promise-mysql2' and ensure the require path matches.
Use 'const mysql = require('promise-mysql2');' (CommonJS).Implement reconnection logic or increase wait_timeout on the MySQL server.