Registry / database / mysql-rest

mysql-rest

JSON →
library0.6.27jsnpmunverified

A CLI tool (v0.6.27) that generates REST API endpoints for MySQL, TiDB, and Dameng databases with a single command. Supports multi-database configurations, connection pooling, custom sorting, ref-by checks, includes, and raw SQL execution. Standalone binary packaging via pkg.sh eliminates Node.js runtime dependency. Active development with frequent releases, differs from alternatives by focusing on Chinese database ecosystems.

npm install mysql-rest
INSTALL
IMPORT
SIG · MYSQL-REST
M
mysql-rest
databasejavascriptv0.6.27
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.

xmysql CLI
npx xmysql -h localhost -u root -p password
npm install -g xmysql && xmysql
The package provides a CLI only; no programmatic API. Use npx for ephemeral execution.
mysql2
import mysql from 'mysql2/promise'
const mysql = require('mysql2')
mysql2 is an internal dependency; users do not need to import it directly. This entry is illustrative.
Express app
No programmatic import — starts an Express server automatically.
The tool runs its own Express server; you cannot import the server or API object in your code.

Launch REST API server for MySQL database on localhost:15000, providing CRUD endpoints for all tables.

xmysql --dialect mysql -h localhost -u root -p mypassword
Debug
Known issues
gotchaDefault port 15000 may conflict with other services.
fix
Use --port flag to specify a different port.
affects: >=0.0.0
gotchaNo authentication built-in; REST API is exposed without auth.
fix
Add a reverse proxy with authentication (e.g., nginx + basic auth) or use firewall rules.
affects: >=0.0.0
gotchaRaw SQL endpoint (/api/raw) can execute arbitrary statements, including DROP/ALTER.
fix
Disable raw endpoint by not exposing it, or restrict network access.
affects: >=0.6.0
breakingSwitched --dialec to --dialect; old flag no longer works.
fix
Use --dialect instead of --dialec.
affects: >=0.6.0
deprecatedStandalone mode via --standalone flag is deprecated; use pkg.sh to build binaries.
fix
Remove --standalone flag and instead run ./pkg.sh to generate standalone binary.
affects: >=0.6.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED 127.0.0.1:3306
MySQL service not running or wrong host/port.
fix
Ensure MySQL is running and accessible: mysql -h localhost -u root -p.
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol
MySQL 8+ default auth plugin caching_sha2_password not supported.
fix
Run: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Error: Dialect 'mysql' not supported. Supported: mysql, tidb, dameng
Typo in dialect name.
fix
Use one of: mysql, tidb, dameng. Check spelling.
Cannot find module 'dmdb'
Dameng native module not built for target platform.
fix
Rebuild with pkg.sh or install dmdb driver: npm install dmdb.
Upgrade
Version history
0.6.27latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
mysql-rest — npm install mysql-rest · libregistry