Registry / database / db-mysql

db-mysql

JSON →
library0.7.6jsnpmunverified

MySQL database bindings for Node.js providing a native client library. Version 0.7.6 (last released in 2011) is effectively abandoned; it depends on libmysqlclient and only supports old Node.js versions (>=0.4.1). Not recommended for new projects; use mysql2 or mysql instead.

npm install db-mysql
INSTALL
IMPORT
SIG · DB-MYSQL
D
db-mysql
databasejavascriptv0.7.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

db-mysql (require)
var db = require('db-mysql');
import db from 'db-mysql';
Package predates ES modules; must use CommonJS require.

Shows connecting to MySQL, executing a query, and handling results with a callback.

var db = require('db-mysql'); var client = db.createClient({ host: 'localhost', user: 'root', password: process.env.DB_PASSWORD ?? '' }); client.query('SELECT 1', function(err, results) { if (err) throw err; console.log(results); client.close(); });
Debug
Known issues
breakingPackage is abandoned; no updates since 2011. Does not support modern Node.js, MySQL 8+, or authentication plugins like caching_sha2_password.
fix
Migrate to mysql2 or mysql package.
affects: all
gotchaRequires libmysqlclient installed on the system. npm install may fail without native build toolchain.
fix
Install build-essential, mysql-devel, or use a precompiled binary if available.
affects: all
deprecatedUses old callback pattern; no Promise or async/await support.
fix
Use mysql2 which supports promises.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'db-mysql'
Package not installed or failed to build native addon.
fix
Run npm install db-mysql --build-from-source or switch to a pure JS driver.
Error: libmysqlclient.so.18: cannot open shared object file
Missing MySQL client library on system.
fix
Install libmysqlclient-dev (Linux) or use a newer driver that includes bundled client libraries.
Upgrade
Version history
0.7.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
db-mysql — npm install db-mysql · libregistry