{"id":43386,"library":"mysqlutil","title":"mysqlutil","description":"A minuscule wrapper around the popular node-mysql (mysql) package for Node.js. Version 0.1.28 is the latest stable release (last updated 2016-01-03). It provides a simplified API for MySQL connections and query execution, supporting connection pooling, multiple statement execution, and result formatting. Unlike more modern alternatives (e.g., mysql2, knex), mysqlutil is a thin convenience layer, leaving full control to the user. No longer actively maintained.","status":"maintenance","version":"0.1.28","language":"javascript","source_language":"en","source_url":"https://github.com/Mindflash/mysqlutil","tags":["javascript","mysql"],"install":[{"cmd":"npm install mysqlutil","lang":"bash","label":"npm"},{"cmd":"yarn add mysqlutil","lang":"bash","label":"yarn"},{"cmd":"pnpm add mysqlutil","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency providing MySQL driver; mysqlutil wraps the mysql module.","package":"mysql","optional":false}],"imports":[{"note":"CommonJS only; no ESM support. Default export is the factory function.","wrong":"import mysqlutil from 'mysqlutil';","symbol":"mysqlutil","correct":"const mysqlutil = require('mysqlutil');"},{"note":"Database class is a named export, but the package uses CommonJS. Use destructuring from require.","wrong":"import { Database } from 'mysqlutil';","symbol":"Database","correct":"const Database = require('mysqlutil').Database;"},{"note":"Export name is capitalized 'ResultSet'.","wrong":"const resultSet = require('mysqlutil').resultSet;","symbol":"ResultSet","correct":"const ResultSet = require('mysqlutil').ResultSet;"}],"quickstart":{"code":"const mysqlutil = require('mysqlutil');\nconst db = mysqlutil.createPool({\n  host: process.env.DB_HOST ?? 'localhost',\n  user: process.env.DB_USER ?? 'root',\n  password: process.env.DB_PASS ?? '',\n  database: process.env.DB_NAME ?? 'test',\n  connectionLimit: 10\n});\n\ndb.query('SELECT 1 AS solution', function(err, results) {\n  if (err) throw err;\n  console.log('The solution is: ', results[0].solution);\n  db.end();\n});","lang":"javascript","description":"Create a connection pool, execute a simple query, and log the result."},"warnings":[{"fix":"Consider migrating to mysql2 or knex for long-term support.","message":"The package is no longer actively maintained as of 2016.","severity":"deprecated","affected_versions":">=0"},{"fix":"Check if `results` is an array of arrays when using multiple statements.","message":"All callbacks follow Node.js convention (err, results) but `results` may be an array of arrays for multiple statements.","severity":"gotcha","affected_versions":">=0"},{"fix":"Update callbacks to handle array of result sets.","message":"0.1.20 changed the signature of `query` to support multiple statements.","severity":"breaking","affected_versions":">=0.1.20"}],"env_vars":null,"search_vec":"'-01':25 '-03':26 '0.1.28':16 '2016':24 'activ':68 'altern':50 'api':31 'around':5 'connect':34,39 'control':62 'conveni':58 'e.g':51 'execut':37,43 'format':46 'full':61 'javascript':70 'knex':53 'last':22 'latest':19 'layer':59 'leav':60 'longer':67 'maintain':69 'minuscul':3 'modern':49 'multipl':41 'mysql':10,11,33,71 'mysql2':52 'mysqlutil':1,54 'node':9 'node-mysql':8 'node.js':14 'packag':12 'pool':40 'popular':7 'provid':28 'queri':36 'releas':21 'result':45 'simplifi':30 'stabl':20 'statement':42 'support':38 'thin':57 'unlik':47 'updat':23 'user':65 'version':15 'wrapper':4","created_at":"2026-06-05T16:59:32.903782+00:00","updated_at":"2026-06-05T16:59:32.903782+00:00","problems":[{"fix":"Use `const mysqlutil = require('mysqlutil');` then `mysqlutil.createPool(...)`.","cause":"Incorrect import; factory function is the default export.","error":"TypeError: mysqlutil.createPool is not a function"},{"fix":"Enable auto-reconnect or increase wait_timeout on MySQL server.","cause":"MySQL server timed out idle connection.","error":"Error: Connection lost: The server closed the connection."}],"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/Mindflash/mysqlutil","github":"https://github.com/Mindflash/mysqlutil","docs":null,"changelog":null,"pypi":null,"npm":"mysqlutil","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}}