Registry / database / mysql-lite

mysql-lite

JSON →
library2016.12.28jsnpmunverified

Zero-dependency fork of mysql v2.12.0, repackaged as a single-file module for Node.js. This package is essentially an archived snapshot of the popular 'mysql' driver from late 2016, stripped of all external dependencies. It is intended for environments where minimal footprint is critical but carries the significant caveat of being unmaintained and frozen at that version. No updates, security patches, or MySQL protocol improvements have been applied since. Only supports Darwin or Linux OS; Windows is not tested. This package is historically notable but not recommended for new projects.

npm install mysql-lite
INSTALL
IMPORT
SIG · MYSQL-LITE
M
mysql-lite
databasejavascriptv2016.12.28
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.

createConnection
✓ import { createConnection } from 'mysql-lite'
✗ const mysql = require('mysql-lite');
Package ships ESM but also supports require(). Use require if CommonJS.
default
✓ import mysql from 'mysql-lite'
✗ const { default: mysql } = require('mysql-lite')
Default export is a namespace object containing createConnection, createPool, etc.
createPool
✓ import { createPool } from 'mysql-lite'
Same API as mysql v2.12.0 but with no external deps.

Connect to MySQL, run a simple SELECT query, and log the result using mysql-lite (mysql v2.12.0 API).

import { createConnection } from 'mysql-lite'; const connection = createConnection({ host: 'localhost', user: 'root', password: process.env.MYSQL_PASSWORD ?? '', database: 'test' }); connection.connect((err) => { if (err) throw err; connection.query('SELECT 1 + 1 AS solution', (err, results, fields) => { if (err) throw err; console.log('The solution is:', results[0].solution); connection.end(); }); });
Debug
Known issues
deprecatedPackage is unmaintained and frozen at MySQL client protocol as of mysql v2.12.0 (2016). No security patches or bug fixes.
fix
Use actively maintained MySQL clients like mysql2 (npm install mysql2).
affects: >=0
gotchaOnly supports Darwin or Linux operating systems. Windows is not tested and may not work.
fix
Use a cross-platform alternative like mysql2 if you need Windows support.
affects: >=0
gotchaThis package is a zero-dependency repackaging but does not include any improvements or bug fixes from later mysql versions. Known vulnerabilities in old protocol may not be addressed.
fix
Consider using mysql2 which is actively maintained and supports prepared statements, promises, etc.
affects: >=0
Errors
Common errors & fixes
Error: Cannot find module 'mysql-lite'
Package not installed or typo in import/require.
fix
Run 'npm install mysql-lite' and verify the package is in node_modules.
Error: connect ECONNREFUSED ::1:3306
MySQL server not running or wrong host/port.
fix
Ensure MySQL is running and accessible. Check connection config: host, port, user, password.
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost'
Incorrect credentials or user lacks permissions.
fix
Verify username and password. Grant necessary privileges or use correct user.
Upgrade
Version history
2016.12.28latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
mysql-lite — npm install mysql-lite · libregistry