{
 "kind": "tool",
 "slug": "mysql2",
 "path": "tools/mysql2/",
 "name": "mysql2",
 "maker": null,
 "density": "basic",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Databases, ORMs and clients",
   "tools/databases-orms/"
  ]
 ],
 "lead": "Fast MySQL driver with native protocol implementation, prepared statements and SSL.",
 "chips": [
  {
   "label": "Databases, ORMs and clients",
   "path": "tools/databases-orms/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install mysql2"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/sidorares/node-mysql2"
  },
  {
   "label": "Website",
   "href": "https://sidorares.github.io/node-mysql2/docs"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/sidorares/node-mysql2"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Oct 13, 2026. ",
   "src": "https://github.com/sidorares/node-mysql2"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "41 projects",
   "status": "info",
   "sub": "#15 of 120 in its category",
   "note": "Dependency in 41 public GitHub projects set up for AI coding agents that we scanned (0.7%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What mysql2 does",
   "parts": [
    {
     "t": "prose",
     "text": "Fast MySQL driver with native protocol implementation, prepared statements and SSL."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "mysql2 popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "66",
       "of": "/ 100",
       "l": "Gid Score, #621 overall"
      },
      {
       "n": "25.6M",
       "l": "downloads a week, npm"
      },
      {
       "n": "4,395",
       "l": "GitHub stars"
      },
      {
       "n": "41",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How mysql2 is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "mysql2 is a dependency in 41 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.8% of the 4,867 JavaScript/TypeScript ones), #15 of 120 in databases, orms and clients.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 93; those are left out of every share on this page.",
      "The most used alternative in our scan is pg (298 projects).",
      "Projects that use it most often also use dotenv (56.1%), Express (41.5%), Zod (61.0%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "23 projects, 0.7%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "17 projects, 0.6%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "14 projects, 0.6%",
       "v": "Cursor",
       "path": "agents/cursor/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 56.1% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 41.5% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 61.0% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 29.3% of its projects",
       "v": "pg",
       "path": "tools/pg/"
      },
      {
       "l": "In 26.8% of its projects",
       "v": "bcryptjs",
       "path": "tools/bcryptjs/"
      },
      {
       "l": "In 26.8% of its projects",
       "v": "jsonwebtoken",
       "path": "tools/jsonwebtoken/"
      },
      {
       "l": "In 75.6% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 24.4% of its projects",
       "v": "Nodemailer",
       "path": "tools/nodemailer/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about mysql2",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/sidorares",
        "4 GitHub sponsors"
       ]
      },
      {
       "title": "More in Databases, ORMs and clients",
       "path": "tools/databases-orms/",
       "items": [
        {
         "text": "Drizzle ORM",
         "path": "tools/drizzle-orm/"
        },
        {
         "text": "Prisma",
         "path": "tools/prisma/"
        },
        {
         "text": "Drizzle Kit",
         "path": "tools/drizzle-kit/"
        },
        {
         "text": "SQLAlchemy",
         "path": "tools/sqlalchemy/"
        },
        {
         "text": "psycopg2",
         "path": "tools/psycopg2-binary/"
        },
        {
         "text": "Alembic",
         "path": "tools/alembic/"
        },
        {
         "text": "Neon Serverless Driver",
         "path": "tools/neondatabase/"
        },
        {
         "text": "psycopg",
         "path": "tools/psycopg/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "mysql2",
       "me": true,
       "facts": [
        "MIT",
        "Gid 66",
        "25.6M/wk"
       ]
      },
      {
       "name": "pg",
       "why": "PostgreSQL client for Node.js with pure JavaScript and libpq API compatibility.",
       "path": "tools/pg/",
       "facts": [
        "MIT",
        "Gid 81",
        "106M/wk"
       ]
      },
      {
       "name": "better-sqlite3",
       "why": "Fastest and simplest SQLite library for Node.js with synchronous API.",
       "path": "tools/better-sqlite3/",
       "facts": [
        "MIT",
        "Gid 72",
        "17.4M/wk"
       ]
      },
      {
       "name": "redis (JavaScript)",
       "why": "Modern high-performance Redis client for Node.js with full feature support.",
       "path": "tools/redis-npm/",
       "facts": [
        "MIT",
        "Gid 73",
        "22.3M/wk"
       ]
      },
      {
       "name": "MongoDB Node Driver",
       "why": "Official Node.js driver for MongoDB providing query builders and connection management.",
       "path": "tools/mongodb/",
       "facts": [
        "Apache-2.0",
        "Gid 71",
        "22.7M/wk"
       ]
      },
      {
       "name": "sqlite3",
       "why": "Asynchronous, non-blocking SQLite3 database bindings for Node.js.",
       "path": "tools/sqlite3/",
       "facts": [
        "BSD-3-Clause",
        "Gid 58",
        "2.9M/wk"
       ]
      }
     ],
     "more": "Compare mysql2 with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install mysql2"
    },
    {
     "t": "gap",
     "text": "No step-by-step start for mysql2 yet: we have not written its hand-checked card."
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm mysql2"
  ],
  [
   "Category",
   "Databases, ORMs and clients"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "65.8"
  ],
  [
   "Rank in category",
   "#15 of 120"
  ],
  [
   "GitHub",
   "sidorares/node-mysql2"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/sidorares.png"
}