Registry / database / kpmysql

kpmysql

JSON →
library1.0.14jsnpmunverified

A Node.js package that provides HTTP RESTful API endpoints to execute MySQL queries, designed for use with Postman or any HTTP client. Version 1.0.14 is the latest stable release with no clear release cadence. Key differentiator: allows database interaction directly via HTTP without custom server code, but lacks modern security features and is intended for local development or testing. Alternative to custom-built API servers or admin tools like phpMyAdmin.

npm install kpmysql
INSTALL
IMPORT
SIG · KPMYSQL
K
kpmysql
databasejavascriptv1.0.14
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.

default
No direct import; run kpmysql.js via Node CLI
const kpmysql = require('kpmysql')
Package is a standalone server, not a library. Common mistake is to try to import it as a module.

Shows how to start the kpmysql server and make a query via HTTP using curl or Node.js http module.

// Assuming kpmysql is installed globally // Run the server // node %APPDATA%\npm\node_modules\kpmysql\kpmysql.js // Then send HTTP requests to http://localhost:3000/mysql with query parameter // Example using curl: // curl "http://localhost:3000/mysql?query=SELECT%201" // For programmatic use (though discouraged): const http = require('http'); const query = 'SELECT 1'; http.get(`http://localhost:3000/mysql?query=${encodeURIComponent(query)}`, (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => console.log(data)); });
Debug
Known issues
gotchaPackage exposes a raw MySQL query endpoint without authentication or parameterization, allowing SQL injection via HTTP requests.
fix
Only use on localhost or behind a firewall; never expose to the internet.
affects: all
gotchaNo input validation on query parameter; malicious or malformed queries can crash the server or corrupt data.
fix
Implement a whitelist of allowed queries or use a middleware to sanitize input.
affects: all
gotchaServer runs on port 3000 by default, which may conflict with other services (e.g., common dev servers).
fix
Modify the source to change port or use process manager to assign alternate port.
affects: all
Errors
Common errors & fixes
Cannot find module 'express'
Express is not installed or not in the module path.
fix
Run 'npm install express' in the project directory or install globally.
Error: Cannot enqueue Handshake after invoking quit.
Connection closed prematurely or multiple queries attempted after disconnect.
fix
Ensure only one query per request or restart the server.
Upgrade
Version history
1.0.14latest on npm
Audit
Dependencies
expressrequiredHTTP server framework for RESTful API endpoints
mysqlrequiredMySQL database driver for Node.js, used to execute queries
Agent activity
9 hits · last 30 days
node
8
Resources
kpmysql — npm install kpmysql · libregistry