{"id":43344,"library":"mysql-restful","title":"MySQL RESTful API Server","description":"A rapid RESTful API server for MySQL databases that automatically imports database structure and creates metadata for CRUD operations. Current version 0.8.1. It exposes two ports: one for administration (HTTPS) and one for API requests. Key differentiators: automatic metadata generation, batch commands with transactions, pre/post operation hooks, and SSL support. It is a self-contained server that uses Express-like patterns but is not actively maintained.","status":"active","version":"0.8.1","language":"javascript","source_language":"en","source_url":"https://github.com/QBisConsult/mysql-restful","tags":["javascript"],"install":[{"cmd":"npm install mysql-restful","lang":"bash","label":"npm"},{"cmd":"yarn add mysql-restful","lang":"bash","label":"yarn"},{"cmd":"pnpm add mysql-restful","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Node.js MySQL driver for database connectivity","package":"mysql","optional":false},{"reason":"Required for self-signed SSL certificate generation","package":"openssl","optional":false}],"imports":[{"note":"CommonJS require returns the server object directly; no default export.","wrong":"const server = require('mysql-restful').default;","symbol":"server","correct":"const server = require('mysql-restful');"},{"note":"start() accepts an optional settings object, but not passing it uses defaults.","wrong":"server.start({port: 8080});","symbol":"start","correct":"server.start();"},{"note":"Metadata is accessed via method on server object, not a separate module.","wrong":"const metadata = require('mysql-restful/metadata');","symbol":"metadata","correct":"server.getMetadata();"}],"quickstart":{"code":"const server = require('mysql-restful');\n\n// Optional settings object\nconst settings = {\n  apiPort: 3000,\n  adminPort: 443,\n  protocol: 'https',\n  database: {\n    host: 'localhost',\n    user: 'root',\n    password: process.env.DB_PASSWORD ?? '',\n    database: 'myapp'\n  }\n};\n\nserver.start(settings);\n\n// Server will scan DB and create RESTful endpoints\n// GET http://localhost:3000/tableName/1 -> reads record with ID 1\n// POST http://localhost:3000/tableName -> inserts record","lang":"javascript","description":"Shows basic setup: require, optional settings, and start. Demonstrates how to connect to a MySQL database and expose RESTful endpoints."},"warnings":[{"fix":"Install OpenSSL or provide ssl/service.crt and ssl/service.key files before starting.","message":"Server requires OpenSSL to generate self-signed certificate on first start; startup fails if OpenSSL not installed.","severity":"gotcha","affected_versions":"all"},{"fix":"Run 'sudo setcap cap_net_bind_service=+ep /usr/local/bin/node' or use non-privileged ports via settings.","message":"Default ports are 80 (HTTP API) and 443 (HTTPS admin). On Linux, binding to these ports requires either root or setcap.","severity":"gotcha","affected_versions":"all"},{"fix":"Restart the server after any schema changes, or manually update metadata via admin interface.","message":"Metadata is cached on startup; database schema changes after start are not reflected until server restart.","severity":"breaking","affected_versions":"all"},{"fix":"Replace with a valid SSL certificate (ssl/service.crt and ssl/service.key) or disable HTTPS for admin.","message":"Self-signed SSL certificate generated at first start is not trusted by browsers; admin interface will show security warning.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider migrating to a more modern REST API solution or patching to use mysql2.","message":"The package uses mysql driver (v2.x) which is deprecated; newer MySQL 8 authentication might not be supported.","severity":"deprecated","affected_versions":"<=0.8.1"}],"env_vars":null,"search_vec":"'0.8.1':26 'activ':71 'administr':33 'api':3,8,38 'automat':14,42 'batch':45 'command':46 'contain':60 'creat':19 'crud':22 'current':24 'databas':12,16 'differenti':41 'expos':28 'express':65 'express-lik':64 'generat':44 'hook':51 'https':34 'import':15 'javascript':73 'key':40 'like':66 'maintain':72 'metadata':20,43 'mysql':1,11 'one':31,36 'oper':23,50 'pattern':67 'port':30 'pre/post':49 'rapid':6 'request':39 'rest':2,7 'self':59 'self-contain':58 'server':4,9,61 'ssl':53 'structur':17 'support':54 'transact':48 'two':29 'use':63 'version':25","created_at":"2026-06-05T16:59:21.335910+00:00","updated_at":"2026-06-05T16:59:21.335910+00:00","problems":[{"fix":"npm install mysql-restful --save","cause":"Package not installed.","error":"Error: Cannot find module 'mysql-restful'"},{"fix":"Use setcap as described, or change apiPort to >1024.","cause":"Trying to bind to privileged port without sufficient permissions.","error":"Error: listen EACCES: permission denied 0.0.0.0:80"},{"fix":"Add the certificate to trusted store, or use a valid certificate.","cause":"Default self-signed certificate is untrusted.","error":"Error: self signed certificate in certificate chain"}],"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/QBisConsult/mysql-restful#readme","github":"https://github.com/QBisConsult/mysql-restful","docs":null,"changelog":null,"pypi":null,"npm":"mysql-restful","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}}