tidbx-javascript-mysql2
Installation
SKILL.md
TiDB + JavaScript (mysql2)
Use this skill to connect to TiDB from Node.js with the mysql2 driver (promise API), configure TLS correctly for TiDB Cloud, and provide small runnable snippets you can copy into a project.
Important: mysql vs mysql2
These two drivers are easy to mix up:
- This skill is for mysql2 (
npm i mysql2) and uses the promise API (mysql2/promise). - If you meant mysqljs/mysql (
npm i mysql) which is callback-based, jump to thetidbx-javascript-mysqljsskill instead.
Recommendation: prefer an ORM for app code
For most application code (models, migrations, types), prefer an ORM/query builder:
- Prisma ORM: use
tidbx-prisma - Kysely query builder: use
tidbx-kysely