{"id":43294,"library":"mysql-lite","title":"mysql-lite","description":"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.","status":"deprecated","version":"2016.12.28","language":"javascript","source_language":"en","source_url":"https://github.com/kaizhu256/node-mysql-lite","tags":["javascript","db","mariadb","mysql","sql"],"install":[{"cmd":"npm install mysql-lite","lang":"bash","label":"npm"},{"cmd":"yarn add mysql-lite","lang":"bash","label":"yarn"},{"cmd":"pnpm add mysql-lite","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package ships ESM but also supports require(). Use require if CommonJS.","wrong":"const mysql = require('mysql-lite');","symbol":"createConnection","correct":"import { createConnection } from 'mysql-lite'"},{"note":"Default export is a namespace object containing createConnection, createPool, etc.","wrong":"const { default: mysql } = require('mysql-lite')","symbol":"default","correct":"import mysql from 'mysql-lite'"},{"note":"Same API as mysql v2.12.0 but with no external deps.","wrong":null,"symbol":"createPool","correct":"import { createPool } from 'mysql-lite'"}],"quickstart":{"code":"import { createConnection } from 'mysql-lite';\nconst connection = createConnection({\n  host: 'localhost',\n  user: 'root',\n  password: process.env.MYSQL_PASSWORD ?? '',\n  database: 'test'\n});\nconnection.connect((err) => {\n  if (err) throw err;\n  connection.query('SELECT 1 + 1 AS solution', (err, results, fields) => {\n    if (err) throw err;\n    console.log('The solution is:', results[0].solution);\n    connection.end();\n  });\n});","lang":"typescript","description":"Connect to MySQL, run a simple SELECT query, and log the result using mysql-lite (mysql v2.12.0 API)."},"warnings":[{"fix":"Use actively maintained MySQL clients like mysql2 (npm install mysql2).","message":"Package is unmaintained and frozen at MySQL client protocol as of mysql v2.12.0 (2016). No security patches or bug fixes.","severity":"deprecated","affected_versions":">=0"},{"fix":"Use a cross-platform alternative like mysql2 if you need Windows support.","message":"Only supports Darwin or Linux operating systems. Windows is not tested and may not work.","severity":"gotcha","affected_versions":">=0"},{"fix":"Consider using mysql2 which is actively maintained and supports prepared statements, promises, etc.","message":"This 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.","severity":"gotcha","affected_versions":">=0"}],"env_vars":null,"search_vec":"'2016':34 'appli':73 'archiv':25 'carri':51 'caveat':54 'critic':49 'darwin':77 'db':97 'depend':6,39 'driver':31 'environ':44 'essenti':23 'extern':38 'file':16 'footprint':47 'fork':7 'frozen':59 'histor':88 'improv':70 'intend':42 'javascript':96 'late':33 'linux':79 'lite':3 'mariadb':98 'minim':46 'modul':17 'mysql':2,9,30,68,99 'mysql-lit':1 'new':94 'node.js':19 'notabl':89 'os':80 'packag':21,86 'patch':66 'popular':29 'project':95 'protocol':69 'recommend':92 'repackag':11 'secur':65 'signific':53 'sinc':74 'singl':15 'single-fil':14 'snapshot':26 'sql':100 'strip':35 'support':76 'test':84 'unmaintain':57 'updat':64 'v2.12.0':10 'version':62 'window':81 'zero':5 'zero-depend':4","created_at":"2026-06-05T16:59:06.654314+00:00","updated_at":"2026-06-05T16:59:06.654314+00:00","problems":[{"fix":"Run 'npm install mysql-lite' and verify the package is in node_modules.","cause":"Package not installed or typo in import/require.","error":"Error: Cannot find module 'mysql-lite'"},{"fix":"Ensure MySQL is running and accessible. Check connection config: host, port, user, password.","cause":"MySQL server not running or wrong host/port.","error":"Error: connect ECONNREFUSED ::1:3306"},{"fix":"Verify username and password. Grant necessary privileges or use correct user.","cause":"Incorrect credentials or user lacks permissions.","error":"Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/kaizhu256/node-mysql-lite#readme","github":"https://github.com/kaizhu256/node-mysql-lite","docs":null,"changelog":null,"pypi":null,"npm":"mysql-lite","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}