Registry / database / node-mysql-admin

node-mysql-admin

JSON →
library0.1.8jsnpmunverified

Node MySQL Admin provides a web-based MySQL database management interface (similar to phpMyAdmin) for Express and Koa applications. Version 0.1.8 is the latest but appears to be in maintenance mode with no recent updates. It requires a MySQL server and does not support Windows. Unlike more modern solutions (e.g., Adminer or phpMyAdmin), this package is tightly coupled to Express middleware and requires passing the app instance. The project has low adoption and may have security concerns due to direct database access and lack of authentication middleware. Not recommended for production.

npm install node-mysql-admin
INSTALL
IMPORT
SIG · NODE-MYSQL-ADMIN
N
node-mysql-admin
databasejavascriptv0.1.8
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
const mysqlAdmin = require('node-mysql-admin');
import mysqlAdmin from 'node-mysql-admin';
Package uses CommonJS and does not support ES modules. Only require() works.
app.use
app.use(mysqlAdmin(app));
app.use(mysqlAdmin());
The middleware factory expects the Express app itself as the first argument to set up routes correctly.
Koa integration
const expressApp = express(); expressApp.use(mysqlAdmin(expressApp)); app.use(function(ctx, next) { /* manual routing */ });
const Koa = require('koa'); Koa().use(mysqlAdmin(Koa()));
Koa users must wrap Express middleware manually; direct Koa usage is not supported.

Shows minimal Express setup with node-mysql-admin middleware. Access the admin interface at /myadmin endpoint.

const express = require('express'); const mysqlAdmin = require('node-mysql-admin'); const app = express(); app.use(mysqlAdmin(app)); app.listen(3000, () => console.log('Navigate to http://localhost:3000/myadmin'));
Debug
Known issues
breakingnode-mysql-admin does not support Windows. Attempting to install or run on Windows will fail.
fix
Use a different MySQL admin tool on Windows (e.g., phpMyAdmin, Adminer).
affects: <=0.1.8
breakingThe middleware requires the Express app instance as the first argument to mysqlAdmin().
fix
Ensure you call `mysqlAdmin(app)` with the app variable, not just `mysqlAdmin()`.
affects: >=0.1.0
deprecatedThe package has not been updated since 2018 and likely contains unpatched vulnerabilities.
fix
Consider switching to actively maintained alternatives like 'mysql2' with a custom admin interface or phpMyAdmin.
affects: all
gotchaUsing with Koa requires manual Express sub-application routing; the package does not natively support Koa.
fix
Follow the Koa integration example in the README: create an Express app, add middleware, and route to expressApp manually.
affects: all
breakingThe mysql dependency is mandatory; without it the require fails at runtime.
fix
Install mysql (or mysql2) separately: npm install mysql
affects: all
gotchaLogin page exposes MySQL credentials; no built-in encryption or session management beyond basic login.
fix
Use HTTPS and restrict access with Express middleware (e.g., basic-auth) to protect the /myadmin route.
affects: all
Errors
Common errors & fixes
Cannot find module 'mysql'
Missing peer dependency mysql.
fix
Run `npm install mysql` in your project.
TypeError: mysqlAdmin is not a function
Incorrect import style (e.g., using ES import with a CJS module).
fix
Use `const mysqlAdmin = require('node-mysql-admin');` instead of import.
Error: listen EADDRINUSE :::3000
Port already in use by another process.
fix
Use a different port or kill the process occupying port 3000.
Koa: node-mysql-admin does not work directly on Koa
Trying to use node-mysql-admin as Koa middleware without Express wrapper.
fix
Create an Express sub-app and route /myadmin to it as shown in the README.
Upgrade
Version history
0.1.8latest on npm
Audit
Dependencies
expressoptionalRequired as a peer dependency; the middleware expects an Express app instance passed as argument.
mysqlrequiredMySQL database driver; used to connect and query the MySQL server.
Agent activity
5 hits · last 30 days
node
4
Resources
node-mysql-admin — npm install node-mysql-admin · libregistry